11import 'package:flutter/material.dart' ;
22import 'parallel_animation_logo.dart' ;
3+ import 'package:animated_interpolation/animated_interpolation.dart' ;
34
45void main () => runApp (MyApp ());
56
@@ -26,22 +27,49 @@ class MyApp extends StatelessWidget {
2627 }
2728}
2829
29- class MyHomePage extends StatefulWidget {
30+ class AnimatedCell extends StatelessWidget {
31+ @override
32+ Widget build (BuildContext context) {
33+ GlobalKey <SmartAnimatedWidgetState > key = GlobalKey <SmartAnimatedWidgetState >();
3034
35+ return GestureDetector (
36+ onTap: () {
37+ key.currentState.animate ();
38+ print ("**************tap*************" );
39+ },
40+ child: SmartAnimatedWidget (
41+ configMap: slideOutDown,
42+ key: key,
43+ autoPlay: false ,
44+ child: Container (
45+ margin: const EdgeInsets .symmetric (vertical: 8 , horizontal: 15 ),
46+ padding: const EdgeInsets .symmetric (vertical: 8 , horizontal: 15 ),
47+ width: double .infinity,
48+ color: Colors .red.shade300,
49+ child: Center (
50+ child: Text ("BounceIn" ),
51+ ),
52+ )),
53+ );
54+ }
55+ }
56+
57+ class MyHomePage extends StatefulWidget {
3158 @override
3259 _MyHomePageState createState () => _MyHomePageState ();
3360}
3461
3562class _MyHomePageState extends State <MyHomePage > {
36-
3763 @override
3864 Widget build (BuildContext context) {
3965 return Scaffold (
4066 appBar: AppBar (
4167 title: Text ("Animation" ),
4268 ),
43- body: Center (
44- child: LogoApp4 (),
69+ body: Column (
70+ children: < Widget > [
71+ AnimatedCell (),
72+ ],
4573 ),
4674 );
4775 }
0 commit comments