TweenAnimationBuilder Example

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



<p>Here is an example of TweenAnimationBuilder. _MyAppState(); }</p> <p>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), ), ), ); } } `</p>


Tags:








0 Comments
Login to comment.
Recent Comments