@@ -46,55 +46,55 @@ class _AnimatedContainerExampleState extends State<AnimatedContainerExample>
4646
4747 @override
4848 Widget build (BuildContext context) {
49- double itemWidth = ((_count % 3 ) + 1 ) * 100 ;
49+ double itemWidth = ((_count % 3 ) + 1 ) * 70 ;
5050 double itemHeight = ((_count % 3 ) + 1 ) * 60 ;
51- return SizedBox .expand (
52- child: Padding (
53- padding: const EdgeInsets .all (16.0 ),
54- child: Column (
55- crossAxisAlignment: CrossAxisAlignment .start,
56- mainAxisAlignment: MainAxisAlignment .spaceEvenly,
57- children: < Widget > [
58- ExampleHeader (
59- title: 'AnimatedContainer' ,
60- description:
61- 'An AnimatedContainer can automatically interpolate between differents values of his properties( width, height, color, padding).' ),
62- ConstrainedBox (
63- constraints: BoxConstraints (maxHeight: 100 ),
64- child: AnimationControl (
65- duration: _duration,
66- curve: _currentCurve,
67- /*direction: Axis.vertical,*/
68- animationController: animationController,
69- onDurationChanged: (value) =>
70- setState (() => _duration += value),
71- onCurveChanged: (curve) =>
72- setState (() => _currentCurve = curve),
73- ),
51+ return Padding (
52+ padding: const EdgeInsets .all (16.0 ),
53+ child: ListView (
54+ /*crossAxisAlignment: CrossAxisAlignment.start,
55+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,*/
56+ children: < Widget > [
57+ ExampleHeader (
58+ title: 'AnimatedContainer' ,
59+ description:
60+ 'An AnimatedContainer can automatically interpolate between differents values of his properties( width, height, color, padding).' ),
61+ ConstrainedBox (
62+ constraints: BoxConstraints (maxHeight: 100 ),
63+ child: AnimationControl (
64+ duration: _duration,
65+ curve: _currentCurve,
66+ /*direction: Axis.vertical,*/
67+ animationController: animationController,
68+ onDurationChanged: (value) => setState (() {
69+ _duration += value;
70+ //animationController.duration = _duration;
71+ }),
72+ onCurveChanged: (curve) => setState (() => _currentCurve = curve),
7473 ),
75- Expanded (
76- child: AnimationContainer (
77- child: Center (
78- child: AnimatedContainer (
79- duration: aMillisecond * _duration,
80- curve: _currentCurve,
81- color: Colors .primaries[(_count % 8 ).floor ()],
82- height: itemHeight,
83- width: itemWidth,
84- child: Center (
85- child: Text (
86- 'Animated Container' ,
87- textAlign: TextAlign .center,
88- style: TextStyle (
89- color: Colors .white,
90- ),
91- )),
92- ),
74+ ),
75+ ConstrainedBox (
76+ constraints: BoxConstraints (maxHeight: 300 ),
77+ child: AnimationContainer (
78+ child: Center (
79+ child: AnimatedContainer (
80+ duration: aMillisecond * _duration,
81+ curve: _currentCurve,
82+ color: Colors .primaries[(_count % 8 ).floor ()],
83+ height: itemHeight,
84+ width: itemWidth,
85+ child: Center (
86+ child: Text (
87+ 'Animated Container' ,
88+ textAlign: TextAlign .center,
89+ style: TextStyle (
90+ color: Colors .white,
91+ ),
92+ )),
9393 ),
9494 ),
95- )
96- ],
97- ) ,
95+ ),
96+ )
97+ ] ,
9898 ),
9999 );
100100 }
0 commit comments