forked from md-siam/package_of_the_day
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimations.dart
71 lines (69 loc) · 2.39 KB
/
animations.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
class MyAnimations extends StatelessWidget {
const MyAnimations({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Animations')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 20),
OpenContainer(
openColor: Colors.deepPurple.shade900,
transitionDuration: const Duration(seconds: 1),
transitionType: ContainerTransitionType.fadeThrough,
closedBuilder: (context, action) {
return Container(
height: 200,
width: 200,
decoration: BoxDecoration(
color: Colors.deepPurple[300],
borderRadius: BorderRadius.circular(15),
),
child: const Center(
child: Text(
'Small widget',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
);
},
openBuilder: (context, action) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Center(
child: Container(
height: 300,
width: 300,
decoration: BoxDecoration(
color: Colors.deepPurple[300],
borderRadius: BorderRadius.circular(15),
),
child: const Center(
child: Text(
'Big screen',
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
),
),
FloatingActionButton(
onPressed: () {
Navigator.pop(context);
},
child: const Icon(Icons.arrow_back),
),
],
);
},
),
],
),
),
);
}
}