multi_animated_builder 0.1.0
multi_animated_builder: ^0.1.0 copied to clipboard
An AnimatedBuilder that takes a list of Listenable and rebuilds when any of them fire.
This widget overcomes the limitation of AnimatedBuilder
of listening to only one object.
int n = 0;
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MultiAnimatedBuilder(
animations: [myNotifier1, myNotifier2],
build: (context) {
return Text('Rebuilt ${++n} times.');
},
);
}
}