Skip to content

Commit dedf48b

Browse files
author
Jack
committed
Added Signup Page 2
1 parent d0be932 commit dedf48b

14 files changed

+411
-181
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@
3737
<category android:name="android.intent.category.LAUNCHER"/>
3838
</intent-filter>
3939
</activity>
40+
<!-- Replace YOUR_API_KEY with your Google Place API Key -->
41+
<meta-data
42+
android:name="com.google.android.geo.API_KEY"
43+
android:value="YOUR_API_KEY"/>
4044
</application>
4145
</manifest>

android/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,14 @@ subprojects {
2929
task clean(type: Delete) {
3030
delete rootProject.buildDir
3131
}
32+
33+
subprojects {
34+
project.configurations.all {
35+
resolutionStrategy.eachDependency { details ->
36+
if (details.requested.group == 'com.android.support'
37+
&& !details.requested.name.contains('multidex') ) {
38+
details.useVersion "26.1.0"
39+
}
40+
}
41+
}
42+
}

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
9705A1C41CF9048500538489 /* Embed Frameworks */,
161161
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
162162
019E91FDB5AE4A565541FDA2 /* [CP] Embed Pods Frameworks */,
163+
208D6AE23DB0AFABEC4F2B4F /* [CP] Copy Pods Resources */,
163164
);
164165
buildRules = (
165166
);
@@ -263,6 +264,32 @@
263264
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
264265
showEnvVarsInLog = 0;
265266
};
267+
208D6AE23DB0AFABEC4F2B4F /* [CP] Copy Pods Resources */ = {
268+
isa = PBXShellScriptBuildPhase;
269+
buildActionMask = 2147483647;
270+
files = (
271+
);
272+
inputFileListPaths = (
273+
);
274+
inputPaths = (
275+
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
276+
"${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle",
277+
"${PODS_ROOT}/GooglePlacePicker/Frameworks/GooglePlacePicker.framework/Resources/GooglePlacePicker.bundle",
278+
"${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
279+
);
280+
name = "[CP] Copy Pods Resources";
281+
outputFileListPaths = (
282+
);
283+
outputPaths = (
284+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle",
285+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlacePicker.bundle",
286+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
287+
);
288+
runOnlyForDeploymentPostprocessing = 0;
289+
shellPath = /bin/sh;
290+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
291+
showEnvVarsInLog = 0;
292+
};
266293
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
267294
isa = PBXShellScriptBuildPhase;
268295
buildActionMask = 2147483647;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

ios/Runner/AppDelegate.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#include "AppDelegate.h"
22
#include "GeneratedPluginRegistrant.h"
3+
@import GooglePlaces;
4+
@import GoogleMaps;
35

46
@implementation AppDelegate
57

68
- (BOOL)application:(UIApplication *)application
79
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
810
[GeneratedPluginRegistrant registerWithRegistry:self];
11+
// Replace YOUR_API_KEY with your Google Place API Key
12+
[GMSPlacesClient provideAPIKey:@"YOUR_API_KEY"];
13+
[GMSServices provideAPIKey:@"YOUR_API_KEY"];
914
// Override point for customization after application launch.
1015
return [super application:application didFinishLaunchingWithOptions:launchOptions];
1116
}

lib/page/signup/SignPageNine.dart

Lines changed: 7 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1-
import 'dart:async';
2-
31
import 'package:flutter/material.dart';
42
import 'package:flutter_ui_nice/page/signup/widgets/signup_apbar.dart';
53
import '../../const/gradient_const.dart';
6-
import '../../const/icons.dart';
74
import '../../const/styles.dart';
8-
import 'package:image_picker/image_picker.dart';
9-
import 'dart:io';
10-
11-
class SignPageNine extends StatefulWidget {
12-
@override
13-
State<StatefulWidget> createState() => SignPageNineState();
14-
}
15-
16-
class SignPageNineState extends State<SignPageNine> {
17-
File _image;
18-
19-
Future getImage() async {
20-
File image = await ImagePicker.pickImage(source: ImageSource.camera);
21-
22-
setState(() {
23-
_image = image;
24-
});
25-
}
5+
import 'widgets/signup_profile_image_picker.dart';
6+
import 'widgets/signup_button.dart';
267

8+
class SignPageNine extends StatelessWidget {
279
@override
2810
Widget build(BuildContext context) {
2911
final double statusbarHeight = MediaQuery.of(context).padding.top;
@@ -88,84 +70,13 @@ class SignPageNineState extends State<SignPageNine> {
8870
),
8971
),
9072
),
91-
Container(
92-
margin: EdgeInsets.only(left: 32.0, right: 72.0, top: 56.0),
93-
child: Stack(
94-
alignment: Alignment.topRight,
95-
children: <Widget>[
96-
Container(
97-
width: 400.0,
98-
height: 182.0,
99-
decoration: BoxDecoration(
100-
boxShadow: [
101-
BoxShadow(
102-
color: Colors.black12,
103-
blurRadius: 15,
104-
spreadRadius: 0,
105-
offset: Offset(0.0, 16.0)),
106-
],
107-
),
108-
child: ClipRRect(
109-
borderRadius: BorderRadius.circular(16.0),
110-
child: _image != null
111-
? Image.file(
112-
_image,
113-
fit: BoxFit.fitWidth,
114-
)
115-
: Image.asset(
116-
'assets/images/signup/signup_page_9_profile.png',
117-
fit: BoxFit.fill,
118-
),
119-
),
120-
),
121-
IconButton(
122-
onPressed: () async {
123-
await getImage();
124-
},
125-
icon: Icon(
126-
IconData(camera, fontFamily: 'Icons'),
127-
color: Color(0xffDBEDAF),
128-
),
129-
)
130-
],
131-
),
132-
),
73+
ProfileImagePicker(
74+
margin:
75+
EdgeInsets.only(left: 32.0, right: 72.0, top: 56.0)),
13376
Positioned(
13477
bottom: 16.0,
13578
right: 18.9,
136-
child: InkWell(
137-
onTap: () {},
138-
child: Container(
139-
padding: EdgeInsets.symmetric(
140-
horizontal: 36.0, vertical: 16.0),
141-
decoration: BoxDecoration(
142-
boxShadow: [
143-
BoxShadow(
144-
color: Colors.black12,
145-
blurRadius: 15,
146-
spreadRadius: 0,
147-
offset: Offset(0.0, 32.0)),
148-
],
149-
borderRadius: new BorderRadius.circular(36.0),
150-
gradient:
151-
LinearGradient(begin: FractionalOffset.centerLeft,
152-
// Add one stop for each color. Stops should increase from 0 to 1
153-
stops: [
154-
0.2,
155-
1
156-
], colors: [
157-
Color(0xff000000),
158-
Color(0xff434343),
159-
])),
160-
child: Text(
161-
'NEXT',
162-
style: TextStyle(
163-
color: Color(0xffF1EA94),
164-
fontWeight: FontWeight.bold,
165-
fontFamily: 'Montserrat'),
166-
),
167-
),
168-
),
79+
child: signupButton('NEXT'),
16980
),
17081
],
17182
),

lib/page/signup/SignPageTwo.dart

Lines changed: 27 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,38 @@
1-
///
2-
/// Created by NieBin on 2018/12/25
3-
/// Github: https://github.com/nb312
4-
5-
///
61
import "package:flutter/material.dart";
72

8-
class SignPageTwo extends StatefulWidget {
9-
@override
10-
_SignTwoState createState() => _SignTwoState();
11-
}
3+
import '../../const/gradient_const.dart';
4+
import 'widgets/date_picker.dart';
5+
import 'widgets/gender_picker.dart';
6+
import 'widgets/location_picker.dart';
7+
import 'widgets/signup_apbar.dart';
8+
import 'widgets/signup_profile_image_picker.dart';
9+
import 'widgets/signup_button.dart';
1210

13-
class _SignTwoState extends State<SignPageTwo> {
11+
class SignPageTwo extends StatelessWidget {
1412
@override
1513
Widget build(BuildContext context) {
1614
return Scaffold(
17-
body: Center(
18-
child: Home(),
15+
appBar: SignupApbar(
16+
title: 'CREATE ACCOUNT',
1917
),
20-
);
21-
}
22-
}
23-
24-
class Home extends StatefulWidget {
25-
Home({Key key}) : super(key: key);
26-
27-
@override
28-
HomeState createState() {
29-
return new HomeState();
30-
}
31-
}
32-
33-
class HomeState extends State<Home> {
34-
bool _hasCard;
35-
36-
@override
37-
void initState() {
38-
super.initState();
39-
_hasCard = false;
40-
}
41-
42-
@override
43-
Widget build(BuildContext context) {
44-
List<Widget> children = new List();
45-
46-
children.add(_buildBackground());
47-
if (_hasCard) children.add(_buildCard());
48-
49-
return MaterialApp(
50-
home: Stack(
51-
children: children,
18+
body: Container(
19+
padding: EdgeInsets.only(top: 64.0),
20+
decoration: BoxDecoration(gradient: SIGNUP_BACKGROUND),
21+
child: ListView(
22+
physics: BouncingScrollPhysics(),
23+
children: <Widget>[
24+
ProfileImagePicker(
25+
margin: EdgeInsets.only(top: 32.0, left: 32.0, right: 32.0),
26+
),
27+
DatePicker(),
28+
GenderPicker(),
29+
LocationPicker(),
30+
Container(
31+
margin: EdgeInsets.only(top: 32.0),
32+
child: Center(child: signupButton('NEXT')))
33+
],
34+
),
5235
),
5336
);
5437
}
55-
56-
void _showCard() {
57-
setState(() => _hasCard = true);
58-
}
59-
60-
void _hideCard() {
61-
setState(() => _hasCard = false);
62-
}
63-
64-
Widget _buildCard() => new Container(
65-
child: new Center(
66-
child: new Container(
67-
height: 700.0,
68-
width: 200.0,
69-
color: Colors.lightBlue,
70-
child: new Center(
71-
child: new Text("Card"),
72-
),
73-
),
74-
),
75-
);
76-
77-
Widget _buildBackground() => new Scaffold(
78-
appBar: new AppBar(
79-
title: new Text("AppBar"),
80-
),
81-
body: new Container(
82-
child: _hasCard
83-
? new FlatButton(
84-
onPressed: _hideCard, child: new Text("Hide card"))
85-
: new FlatButton(
86-
onPressed: _showCard, child: new Text("Show card")),
87-
),
88-
);
89-
}
90-
91-
void main() {
92-
runApp(
93-
new Home(),
94-
);
9538
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import 'package:flutter/material.dart';
2+
import 'dart:async';
3+
import 'package:intl/intl.dart';
4+
5+
class DatePicker extends StatefulWidget {
6+
7+
@override
8+
_DatePickerState createState() => _DatePickerState();
9+
}
10+
11+
class _DatePickerState extends State<DatePicker> {
12+
DateTime date = DateTime.now();
13+
14+
Future _selectDate(BuildContext context) async {
15+
DateTime picker = await showDatePicker(
16+
context: context,
17+
initialDate: date,
18+
firstDate: new DateTime(1900),
19+
lastDate: new DateTime.now()
20+
);
21+
22+
if(picker != null){
23+
setState(() {
24+
date = picker;
25+
});
26+
}
27+
}
28+
29+
@override
30+
Widget build(BuildContext context) {
31+
return InkWell(
32+
onTap: () => _selectDate(context),
33+
child: Container(
34+
margin: EdgeInsets.only(left: 32.0, right: 16.0),
35+
padding: EdgeInsets.symmetric(horizontal: 32.0, vertical: 24.0),
36+
decoration: BoxDecoration(
37+
color: Color(0x3305756D),
38+
borderRadius: BorderRadius.circular(12.0)
39+
),
40+
child: Row(
41+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
42+
children: <Widget>[
43+
Text('BIRTHDAY', style: TextStyle(
44+
letterSpacing: 2.0,
45+
fontFamily: 'Montserrat'
46+
),),
47+
Text(new DateFormat('d MMM y').format(date),
48+
style: TextStyle(
49+
letterSpacing: 2.0,
50+
color: Color(0xff353535),
51+
fontWeight: FontWeight.bold,
52+
fontFamily: 'Montserrat'
53+
),)
54+
],
55+
),
56+
),
57+
);
58+
}
59+
}

0 commit comments

Comments
 (0)