animStful.
class $NAME$ extends StatefulWidget {
const $NAME$(super.key);
@override
State<$NAME$> createState() => _$NAME$State();
}
class _$NAME$State extends State<$NAME$> with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: Duration(milliseconds: $DURATION$),
);
_controller.addListener(() => setState(() {}));
_animation = Tween<double>(begin: 0, end: 1).animate(_controller);
}
@override
Widget build(BuildContext context) {
return Container();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}
Можно копировать в свой IDE и пользоваться!
#snippets@flutter_amiga
