1
+ import 'dart:math' ;
2
+
3
+ import 'package:flutter_web/animation.dart' ;
1
4
import 'package:flutter_web/material.dart' ;
2
5
import 'package:flutter_web_challenge_profile/helper/ui_helper.dart' ;
3
6
import 'package:flutter_web_challenge_profile/view/profile.dart' ;
@@ -9,7 +12,27 @@ class AboutPage extends StatefulWidget {
9
12
}
10
13
}
11
14
12
- class _AboutState extends State <AboutPage > {
15
+ class _AboutState extends State <AboutPage > with TickerProviderStateMixin {
16
+ AnimationController controller;
17
+ Animation animation;
18
+
19
+ @override
20
+ void initState () {
21
+ super .initState ();
22
+ controller =
23
+ AnimationController (vsync: this , duration: Duration (milliseconds: 300 ));
24
+ animation = Tween (begin: 0.0 , end: 762.0 ).animate (controller)
25
+ ..addListener (() {
26
+ setState (() {});
27
+ })
28
+ ..addStatusListener ((status) {
29
+ if (status == AnimationStatus .completed) {
30
+ index = (index + 1 ) % 2 ;
31
+ controller.reverse ();
32
+ }
33
+ });
34
+ }
35
+
13
36
@override
14
37
Widget build (BuildContext context) {
15
38
screenWidth = MediaQuery .of (context).size.width;
@@ -76,6 +99,30 @@ class _AboutState extends State<AboutPage> {
76
99
"CONTACT" ,
77
100
),
78
101
),
102
+ Padding (
103
+ padding:
104
+ EdgeInsets .only (left: realW (115 ), bottom: realH (34 )),
105
+ child: Container (
106
+ width: realW (2 ),
107
+ height: realH (100 ),
108
+ alignment: Alignment .topCenter,
109
+ color: Color (0xFFC8C1C1 ).withOpacity (0.38 ),
110
+ child: Transform .translate (
111
+ offset: Offset (0 , realH (index * 50.0 )),
112
+ child: Container (
113
+ width: realW (2 ),
114
+ height: realH (50 ),
115
+ color: Colors .black),
116
+ ),
117
+ ),
118
+ ),
119
+ Padding (
120
+ padding:
121
+ EdgeInsets .only (left: realW (106 ), bottom: realH (34 )),
122
+ child: Text (
123
+ "${index + 1 }-2" ,
124
+ ),
125
+ ),
79
126
],
80
127
),
81
128
),
@@ -91,14 +138,14 @@ class _AboutState extends State<AboutPage> {
91
138
top: realH (166 ), bottom: realH (13 )),
92
139
child: Text (
93
140
'JAMES CHARLETON' ,
94
- style: TextStyle ( fontSize: realW (15 )),
141
+ style: TextStyle (fontSize: realW (15 )),
95
142
),
96
143
),
97
144
Padding (
98
145
padding: EdgeInsets .only (bottom: realH (13 )),
99
146
child: Text (
100
147
'ABOUT ME' ,
101
- style: TextStyle ( fontSize: realW (50 )),
148
+ style: TextStyle (fontSize: realW (50 )),
102
149
),
103
150
),
104
151
Hero (
@@ -147,7 +194,7 @@ latest meme
147
194
bottom: realH (9 ),
148
195
),
149
196
child: Text (
150
- '2016 to present Heading inc.' ,
197
+ '2016 to present PayPay inc.' ,
151
198
style: TextStyle (
152
199
fontFamily: 'Montserrat' , fontSize: realW (13 )),
153
200
),
@@ -157,7 +204,7 @@ latest meme
157
204
bottom: realH (13 ),
158
205
),
159
206
child: Text (
160
- 'Android/Flutter engineer ' ,
207
+ 'Sr. User experience designer, Foundations ' ,
161
208
style: TextStyle (
162
209
fontFamily: 'Montserrat' ,
163
210
fontSize: realW (12 ),
@@ -188,7 +235,8 @@ rage of product design
188
235
),
189
236
Padding (
190
237
padding: EdgeInsets .all (0 ),
191
- child: Image .asset ('Unisa.png' ),
238
+ child: Image .asset (
239
+ index % 2 == 0 ? 'Unisa.png' : 'Pinterest.png' ),
192
240
)
193
241
],
194
242
),
@@ -202,14 +250,34 @@ rage of product design
202
250
crossAxisAlignment: CrossAxisAlignment .start,
203
251
mainAxisAlignment: MainAxisAlignment .start,
204
252
children: < Widget > [
205
- Hero (
206
- tag: 'image' ,
207
- child: Image .asset (
208
- 'crystal-shaw-515211-unsplash.png' ,
253
+ Stack (
254
+ children: < Widget > [
255
+ Hero (
256
+ tag: 'image' ,
257
+ child: GestureDetector (
258
+ onTap: () {
259
+ if (animation.value == 0 ) {
260
+ controller.forward ();
261
+ }
262
+ },
263
+ child: Image .asset (
264
+ index % 2 == 0
265
+ ? 'crystal-shaw-515211-unsplash.png'
266
+ : 'joshua-rawson-harris-495411-unsplash.png' ,
267
+ width: realW (533 ),
268
+ height: realH (762 ),
269
+ fit: BoxFit .fill,
270
+ ),
271
+ )),
272
+ Container (
209
273
width: realW (533 ),
210
- height: realH (762 ),
211
- fit: BoxFit .fill,
212
- )),
274
+ height: realH (animation.value),
275
+ decoration: BoxDecoration (
276
+ color: Colors .black
277
+ .withOpacity (animation.value / 762.0 )),
278
+ ),
279
+ ],
280
+ ),
213
281
Padding (
214
282
padding: EdgeInsets .only (top: realH (29.0 )),
215
283
child: Hero (
0 commit comments