I am trying to animate the button using simplified animation from the GetX (5.0-release-candidate-9) package.
The problem is that the animation method is called only once when the page is loaded, but never called on tap.
Here is the code:
class SettingsView extends GetView<SettingsController> {
const SettingsView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('SettingsView'),
centerTitle: true,
),
body: Center(
child: ValueBuilder<bool>(
initialValue: false,
builder: (isChecked, updateFn) {
print('rebuild performed');
return OutlinedButton(
onPressed: () {
print('pressed ');
updateFn(true);
},
child: Text('Press me'))
.scale(
begin: 0.9,
end: 1,
duration: Duration(milliseconds: 400),
// isSequential: true,
onComplete: (animationController) {
animationController.reset();
//animationController.reverse();
print('animation completed');
//animationController.forward();
// animationController.fling();
// animationController.stop();
//animationController.dispose();
});
}),
),
);
}
}