Skip to content

Commit 1b925c1

Browse files
committed
updateExample
1 parent 22cf7b8 commit 1b925c1

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

example/lib/main.dart

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'parallel_animation_logo.dart';
3+
import 'package:animated_interpolation/animated_interpolation.dart';
34

45
void 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

3562
class _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

Comments
 (0)