1
+ import 'package:align_positioned/align_positioned.dart' ;
1
2
import 'package:animate_do/animate_do.dart' ;
2
3
import 'package:day40/pages/send_money.dart' ;
3
4
import 'package:flutter/material.dart' ;
@@ -76,7 +77,50 @@ class _ContactPageState extends State<ContactPage> {
76
77
child: Column (
77
78
crossAxisAlignment: CrossAxisAlignment .start,
78
79
children: < Widget > [
79
- SizedBox (height: 20 ,),
80
+ SizedBox (height: 50 ,),
81
+ FadeInUp (
82
+ duration: Duration (milliseconds: 500 ),
83
+ child: Container (
84
+ width: double .infinity,
85
+ height: 300 ,
86
+ padding: EdgeInsets .all (90.0 ),
87
+ decoration: BoxDecoration (
88
+ shape: BoxShape .circle,
89
+ border: Border .all (color: Colors .grey.shade200, width: 1.0 ),
90
+ ),
91
+ child: Stack (
92
+ children: [
93
+ for (double i = 0 ; i < 360 ; i += 60 )
94
+ AnimChain (
95
+ initialDelay: Duration (milliseconds: i.toInt ())
96
+ )
97
+ .next (
98
+ wait: Duration (milliseconds: 1000 ),
99
+ widget: AnimatedAlignPositioned (
100
+ dx: 0 ,
101
+ dy: 150 ,
102
+ duration: Duration (seconds: 1 ),
103
+ rotateDegrees: 0 ,
104
+ touch: Touch .middle,
105
+ child: user (0 , i),
106
+ ),
107
+ )
108
+ .next (
109
+ wait: Duration (seconds: 2 ),
110
+ widget: AnimatedAlignPositioned (
111
+ dx: i / 360 ,
112
+ dy: 150 ,
113
+ duration: Duration (seconds: 1 ),
114
+ rotateDegrees: i,
115
+ touch: Touch .middle,
116
+ child: user (0 , i),
117
+ ),
118
+ ),
119
+ ],
120
+ ),
121
+ ),
122
+ ),
123
+ SizedBox (height: 80 ,),
80
124
FadeInRight (
81
125
duration: Duration (milliseconds: 500 ),
82
126
child: Padding (
@@ -173,4 +217,50 @@ class _ContactPageState extends State<ContactPage> {
173
217
)
174
218
);
175
219
}
220
+
221
+ user (int index, double number) {
222
+ index = number ~ / 60 ;
223
+ return FadeInRight (
224
+ delay: Duration (seconds: 1 ),
225
+ duration: Duration (milliseconds: (index * 100 ) + 500 ),
226
+ child: GestureDetector (
227
+ onTap: () {
228
+ Navigator .push (context,
229
+ MaterialPageRoute (
230
+ builder: (context) => SendMoney (
231
+ name: _contacts[index]['name' ],
232
+ avatar: _contacts[index]['avatar' ]
233
+ )
234
+ )
235
+ );
236
+ },
237
+ child: Container (
238
+ margin: EdgeInsets .only (right: 20 ),
239
+ child: Column (
240
+ mainAxisAlignment: MainAxisAlignment .center,
241
+ children: < Widget > [
242
+ Transform .rotate (
243
+ angle: number / 60 * 5.2 ,
244
+ child: CircleAvatar (
245
+ radius: 30 ,
246
+ backgroundColor: Colors .green.shade100,
247
+ backgroundImage: AssetImage (_contacts[index]['avatar' ]),
248
+ ),
249
+ ),
250
+ ],
251
+ ),
252
+ ),
253
+ ),
254
+ );
255
+ }
256
+
257
+ Container circle (Color color, [double diameter = 50.0 ]) {
258
+ return Container (
259
+ width: diameter,
260
+ height: diameter,
261
+ decoration: BoxDecoration (
262
+ color: color,
263
+ shape: BoxShape .circle,
264
+ ));
265
+ }
176
266
}
0 commit comments