AnimatedBuilder
A general-purpose widget for building animations.
Example
class Spinner extends StatefulWidget { _SpinnerState createState() => _SpinnerState(); } class _SpinnerState extends State<Spinner> with SingleTickerProviderStateMixin { AnimationController _controller; void initState() { super.initState(); _controller = AnimationController( duration: const Duration(seconds: 10), vsync: this, )..repeat(); } void dispose() { _controller.dispose(); super.dispose(); } Widget build(BuildContext context) { return AnimatedBuilder( animation: _controller, child: Container(width: 200.0, height: 200.0, color: Colors.green), builder: (BuildContext context, Widget child) { return Transform.rotate( angle: _controller.value * 2.0 * math.pi, child: child, ); }, ); } }