Skip to content

Commit bcfd589

Browse files
committedJun 9, 2019
完成效果
1 parent e6348c4 commit bcfd589

File tree

6 files changed

+86
-16
lines changed

6 files changed

+86
-16
lines changed
 

‎LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019 ditclear
1+
Copyright (c) 2019git commit -m "first commit" ditclear
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

‎lib/helper/ui_helper.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'dart:core';
33
/// ui standard
44
final standardWidth = 1400.0;
55
final standardHeight = 900.0;
6-
6+
int index = 0;
77
/// late init
88
double screenWidth;
99
double screenHeight;

‎lib/view/about.dart

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import 'dart:math';
2+
3+
import 'package:flutter_web/animation.dart';
14
import 'package:flutter_web/material.dart';
25
import 'package:flutter_web_challenge_profile/helper/ui_helper.dart';
36
import 'package:flutter_web_challenge_profile/view/profile.dart';
@@ -9,7 +12,27 @@ class AboutPage extends StatefulWidget {
912
}
1013
}
1114

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+
1336
@override
1437
Widget build(BuildContext context) {
1538
screenWidth = MediaQuery.of(context).size.width;
@@ -76,6 +99,30 @@ class _AboutState extends State<AboutPage> {
7699
"CONTACT",
77100
),
78101
),
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+
),
79126
],
80127
),
81128
),
@@ -91,14 +138,14 @@ class _AboutState extends State<AboutPage> {
91138
top: realH(166), bottom: realH(13)),
92139
child: Text(
93140
'JAMES CHARLETON',
94-
style: TextStyle( fontSize: realW(15)),
141+
style: TextStyle(fontSize: realW(15)),
95142
),
96143
),
97144
Padding(
98145
padding: EdgeInsets.only(bottom: realH(13)),
99146
child: Text(
100147
'ABOUT ME',
101-
style: TextStyle( fontSize: realW(50)),
148+
style: TextStyle(fontSize: realW(50)),
102149
),
103150
),
104151
Hero(
@@ -147,7 +194,7 @@ latest meme
147194
bottom: realH(9),
148195
),
149196
child: Text(
150-
'2016 to present Heading inc.',
197+
'2016 to present PayPay inc.',
151198
style: TextStyle(
152199
fontFamily: 'Montserrat', fontSize: realW(13)),
153200
),
@@ -157,7 +204,7 @@ latest meme
157204
bottom: realH(13),
158205
),
159206
child: Text(
160-
'Android/Flutter engineer',
207+
'Sr. User experience designer, Foundations',
161208
style: TextStyle(
162209
fontFamily: 'Montserrat',
163210
fontSize: realW(12),
@@ -188,7 +235,8 @@ rage of product design
188235
),
189236
Padding(
190237
padding: EdgeInsets.all(0),
191-
child: Image.asset('Unisa.png'),
238+
child: Image.asset(
239+
index % 2 == 0 ? 'Unisa.png' : 'Pinterest.png'),
192240
)
193241
],
194242
),
@@ -202,14 +250,34 @@ rage of product design
202250
crossAxisAlignment: CrossAxisAlignment.start,
203251
mainAxisAlignment: MainAxisAlignment.start,
204252
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(
209273
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+
),
213281
Padding(
214282
padding: EdgeInsets.only(top: realH(29.0)),
215283
child: Hero(

‎lib/view/profile.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ class _ProfileState extends State<ProfilePage> {
107107
child: Hero(
108108
tag: 'image',
109109
child: Image.asset(
110-
'crystal-shaw-515211-unsplash.png',
110+
index % 2 == 0
111+
? 'crystal-shaw-515211-unsplash.png'
112+
: 'joshua-rawson-harris-495411-unsplash.png',
111113
width: realW(232),
112114
height: realH(287),
113115
fit: BoxFit.fill,

‎web/assets/Pinterest.png

24.2 KB
Loading
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.