1
1
import 'package:flutter/material.dart' ;
2
2
import 'parallel_animation_logo.dart' ;
3
+ import 'package:animated_interpolation/animated_interpolation.dart' ;
3
4
4
5
void main () => runApp (MyApp ());
5
6
@@ -26,22 +27,49 @@ class MyApp extends StatelessWidget {
26
27
}
27
28
}
28
29
29
- class MyHomePage extends StatefulWidget {
30
+ class AnimatedCell extends StatelessWidget {
31
+ @override
32
+ Widget build (BuildContext context) {
33
+ GlobalKey <SmartAnimatedWidgetState > key = GlobalKey <SmartAnimatedWidgetState >();
30
34
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 {
31
58
@override
32
59
_MyHomePageState createState () => _MyHomePageState ();
33
60
}
34
61
35
62
class _MyHomePageState extends State <MyHomePage > {
36
-
37
63
@override
38
64
Widget build (BuildContext context) {
39
65
return Scaffold (
40
66
appBar: AppBar (
41
67
title: Text ("Animation" ),
42
68
),
43
- body: Center (
44
- child: LogoApp4 (),
69
+ body: Column (
70
+ children: < Widget > [
71
+ AnimatedCell (),
72
+ ],
45
73
),
46
74
);
47
75
}
0 commit comments