AnimatedContainer Example

This Article is posted by seven.srikanth at 8/23/2020 8:34:05 AM



<p>Here is an example of AnimatedContainer Widget.</p> <p>_MyAppState(); }</p> <p>class _MyAppState extends State { var counter = 0; double _padding = 20.0; @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AnimatedContainer( color: Colors.red, duration: Duration(milliseconds: 500), child: Text( 'Clicked $counter times', ), ), RaisedButton( onPressed: () { setState(() { counter++; _padding = _padding + 10; }); }, child: Text('Click here'), ) ], ), ), ), ); } } ` Thanks,Srikanth</p>


Tags:








0 Comments
Login to comment.
Recent Comments