TweenAnimationBuilder Example

This Article is posted by seven.srikanth at 8/23/2020 8:35:21 AM

Here is an example of TweenAnimationBuilder. _MyAppState(); } class _MyAppState extends State { var counter = 0; double _padding = 20.0; @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: TweenAnimationBuilder( builder: (BuildContext context, value, Widget child) { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( color: Colors.red, padding: EdgeInsets.all(value), child: Text( 'Clicked $counter times', ), ), RaisedButton( onPressed: () { setState(() { counter++; _padding = _padding + 10; }); }, child: Text('Click here'), ) ], ), ); }, duration: Duration(seconds: 1), tween: Tween(begin: 20.0, end: _padding), ), ), ); } } `

Tags:



0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.




© 2018 - Fluttercentral | Email to me - Seven.srikanth@gmail.com