Showing
5 changed files
with
240 additions
and
91 deletions
... | @@ -3,7 +3,7 @@ import 'package:flutter/services.dart'; | ... | @@ -3,7 +3,7 @@ import 'package:flutter/services.dart'; |
3 | import '../shared/colors.dart'; | 3 | import '../shared/colors.dart'; |
4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
5 | import './SignInPage.dart'; | 5 | import './SignInPage.dart'; |
6 | -import './SignUpPage.dart'; | 6 | +import './SignUpLocal.dart'; |
7 | 7 | ||
8 | class HomePage extends StatefulWidget { | 8 | class HomePage extends StatefulWidget { |
9 | final String pageTitle; | 9 | final String pageTitle; |
... | @@ -125,7 +125,7 @@ class _HomePageState extends State<HomePage> { | ... | @@ -125,7 +125,7 @@ class _HomePageState extends State<HomePage> { |
125 | context, | 125 | context, |
126 | MaterialPageRoute( | 126 | MaterialPageRoute( |
127 | builder: (BuildContext context) => | 127 | builder: (BuildContext context) => |
128 | - SignUpPage(), | 128 | + SignUpLocal(), |
129 | )); | 129 | )); |
130 | }, | 130 | }, |
131 | child: Text( | 131 | child: Text( | ... | ... |
1 | +import 'dart:convert'; | ||
2 | +import 'package:flutter/material.dart'; | ||
3 | + | ||
4 | +class SignUpLocal extends StatefulWidget { | ||
5 | + @override | ||
6 | + _SignUpLocalState createState() => _SignUpLocalState(); | ||
7 | +} | ||
8 | + | ||
9 | +class _SignUpLocalState extends State<SignUpLocal> { | ||
10 | + final emailController = TextEditingController(); | ||
11 | + final passwordController = TextEditingController(); | ||
12 | + final passwordValidController = TextEditingController(); | ||
13 | + final medicineNameController = TextEditingController(); | ||
14 | + final medicineFactureController = TextEditingController(); | ||
15 | + | ||
16 | + bool _validate = false; | ||
17 | + int userRole = 0; | ||
18 | + | ||
19 | + // Initially password is obscure | ||
20 | + bool passwordVisible = false; | ||
21 | + bool passwordValidationVisible = true; | ||
22 | + | ||
23 | + @override | ||
24 | + Widget build(BuildContext context) { | ||
25 | + final Size size = MediaQuery.of(context).size; | ||
26 | + // int goals = 60; | ||
27 | + // int points = 75; | ||
28 | + | ||
29 | + return Scaffold( | ||
30 | + backgroundColor: Colors.white, | ||
31 | + body: ListView( | ||
32 | + children: <Widget>[ | ||
33 | + Padding( | ||
34 | + padding: const EdgeInsets.fromLTRB(20, 25, 20, 0), | ||
35 | + child: Row( | ||
36 | + children: <Widget>[ | ||
37 | + Text( | ||
38 | + '회원 가입', | ||
39 | + textScaleFactor: 1.0, | ||
40 | + style: TextStyle(fontSize: 34), | ||
41 | + ) | ||
42 | + ], | ||
43 | + ), | ||
44 | + ), | ||
45 | + Padding( | ||
46 | + padding: const EdgeInsets.fromLTRB(20, 10, 20, 0), | ||
47 | + child: Row( | ||
48 | + children: <Widget>[ | ||
49 | + Text( | ||
50 | + 'SmartMedicine 회원가입', | ||
51 | + textScaleFactor: 1.0, | ||
52 | + style: TextStyle(fontSize: 16), | ||
53 | + ) | ||
54 | + ], | ||
55 | + ), | ||
56 | + ), | ||
57 | + MediaQuery( | ||
58 | + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), | ||
59 | + child: Container( | ||
60 | + height: size.height * 0.8, | ||
61 | + child: Padding( | ||
62 | + padding: const EdgeInsets.fromLTRB(20, 5, 20, 20), | ||
63 | + child: new Column( | ||
64 | + mainAxisAlignment: MainAxisAlignment.center, | ||
65 | + children: <Widget>[ | ||
66 | + TextFormField( | ||
67 | + keyboardType: TextInputType.text, | ||
68 | + decoration: InputDecoration( | ||
69 | + labelText: '이메일', | ||
70 | + helperText: '아아디로 사용할 이메일 주소를 입력해주세요.', | ||
71 | + ), | ||
72 | + ), | ||
73 | + TextFormField( | ||
74 | + keyboardType: TextInputType.text, | ||
75 | + controller: passwordController, | ||
76 | + obscureText: | ||
77 | + !passwordVisible, //This will obscure text dynamically | ||
78 | + decoration: InputDecoration( | ||
79 | + labelText: '비밀번호', | ||
80 | + helperText: '비밀번호를 입력해주세요', | ||
81 | + // Here is key idea | ||
82 | + suffixIcon: IconButton( | ||
83 | + icon: Icon( | ||
84 | + // Based on passwordVisible state choose the icon | ||
85 | + passwordVisible | ||
86 | + ? Icons.visibility | ||
87 | + : Icons.visibility_off, | ||
88 | + color: Theme.of(context).primaryColorDark, | ||
89 | + ), | ||
90 | + onPressed: () { | ||
91 | + // Update the state i.e. toogle the state of passwordVisible variable | ||
92 | + setState(() { | ||
93 | + passwordVisible = !passwordVisible; | ||
94 | + }); | ||
95 | + }, | ||
96 | + ), | ||
97 | + ), | ||
98 | + ), | ||
99 | + TextFormField( | ||
100 | + onChanged: (text) { | ||
101 | + if (passwordController.text == text) { | ||
102 | + setState(() { | ||
103 | + _validate = false; | ||
104 | + }); | ||
105 | + } else { | ||
106 | + setState(() { | ||
107 | + _validate = true; | ||
108 | + }); | ||
109 | + } | ||
110 | + }, | ||
111 | + keyboardType: TextInputType.text, | ||
112 | + controller: passwordValidController, | ||
113 | + obscureText: | ||
114 | + !passwordValidationVisible, //This will obscure text dynamically | ||
115 | + decoration: InputDecoration( | ||
116 | + labelText: '비밀번호 확인', | ||
117 | + helperText: '비밀번호를 확인해주세요', | ||
118 | + errorText: | ||
119 | + _validate ? '두 비밀번호가 다릅니다. 다시 확인해주세요.' : null, | ||
120 | + // Here is key idea | ||
121 | + suffixIcon: IconButton( | ||
122 | + icon: Icon( | ||
123 | + // Based on passwordVisible state choose the icon | ||
124 | + passwordValidationVisible | ||
125 | + ? Icons.visibility | ||
126 | + : Icons.visibility_off, | ||
127 | + color: Theme.of(context).primaryColorDark, | ||
128 | + ), | ||
129 | + onPressed: () { | ||
130 | + // Update the state i.e. toogle the state of passwordVisible variable | ||
131 | + setState(() { | ||
132 | + passwordValidationVisible = | ||
133 | + !passwordValidationVisible; | ||
134 | + }); | ||
135 | + }, | ||
136 | + ), | ||
137 | + ), | ||
138 | + ), | ||
139 | + TextFormField( | ||
140 | + keyboardType: TextInputType.text, | ||
141 | + controller: medicineNameController, | ||
142 | + decoration: InputDecoration( | ||
143 | + labelText: '약 이름', | ||
144 | + helperText: '약의 이름을 읿력하세요', | ||
145 | + ), | ||
146 | + ), | ||
147 | + TextFormField( | ||
148 | + keyboardType: TextInputType.text, | ||
149 | + controller: medicineFactureController, | ||
150 | + decoration: InputDecoration( | ||
151 | + labelText: '약 제조사 이름', | ||
152 | + helperText: '약 제조사의 이름을 읿력하세요', | ||
153 | + ), | ||
154 | + ), | ||
155 | + ], | ||
156 | + ), | ||
157 | + ), | ||
158 | + ), | ||
159 | + ), | ||
160 | + Container( | ||
161 | + height: 80, | ||
162 | + padding: const EdgeInsets.fromLTRB(20, 20, 20, 20), | ||
163 | + child: RaisedButton( | ||
164 | + onPressed: () async {}, | ||
165 | + shape: RoundedRectangleBorder( | ||
166 | + borderRadius: new BorderRadius.circular(18.0), | ||
167 | + side: BorderSide(color: Colors.blue)), | ||
168 | + color: Color(0xff1674f6), | ||
169 | + child: Text( | ||
170 | + '회원 가입', | ||
171 | + textScaleFactor: 1.0, | ||
172 | + style: TextStyle( | ||
173 | + fontSize: 16, | ||
174 | + color: Colors.white, | ||
175 | + fontWeight: FontWeight.bold), | ||
176 | + ), | ||
177 | + ), | ||
178 | + ) | ||
179 | + ], | ||
180 | + ), | ||
181 | + bottomNavigationBar: BottomAppBar( | ||
182 | + elevation: 0, | ||
183 | + child: Container( | ||
184 | + height: 70, | ||
185 | + child: Column( | ||
186 | + mainAxisAlignment: MainAxisAlignment.start, | ||
187 | + children: <Widget>[ | ||
188 | + Padding( | ||
189 | + padding: const EdgeInsets.fromLTRB(70, 0, 70, 0), | ||
190 | + child: Text( | ||
191 | + '회원 가입시, 이용 야관 및 개인정보 처리 방침에 동의하는 것으로 간주합니다..', | ||
192 | + style: TextStyle(fontSize: 12, color: Color(0xff747474)), | ||
193 | + textAlign: TextAlign.center, | ||
194 | + ), | ||
195 | + ) | ||
196 | + ], | ||
197 | + ), | ||
198 | + ), | ||
199 | + ), | ||
200 | + ); | ||
201 | + } | ||
202 | +} |
1 | -import 'package:flutter/material.dart'; | ||
2 | -import 'package:flutter/services.dart'; | ||
3 | -import '../shared/styles.dart'; | ||
4 | -import '../shared/colors.dart'; | ||
5 | -import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
6 | -import 'package:page_transition/page_transition.dart'; | ||
7 | -import '../shared/inputFields.dart'; | ||
8 | -import './SignInPage.dart'; | ||
9 | -import './DashBoard.dart'; | ||
10 | - | ||
11 | -class SignUpPage extends StatefulWidget { | ||
12 | - final String pageTitle; | ||
13 | - | ||
14 | - SignUpPage({Key key, this.pageTitle}) : super(key: key); | ||
15 | - | ||
16 | - @override | ||
17 | - _SignUpPageState createState() => _SignUpPageState(); | ||
18 | -} | ||
19 | - | ||
20 | -class _SignUpPageState extends State<SignUpPage> { | ||
21 | - @override | ||
22 | - Widget build(BuildContext context) { | ||
23 | - return Scaffold( | ||
24 | - appBar: AppBar( | ||
25 | - elevation: 0, | ||
26 | - backgroundColor: white, | ||
27 | - title: Text('Sign Up', | ||
28 | - style: TextStyle( | ||
29 | - color: Colors.grey, fontFamily: 'Poppins', fontSize: 15)), | ||
30 | - actions: <Widget>[ | ||
31 | - FlatButton( | ||
32 | - onPressed: () { | ||
33 | - // Navigator.of(context).pushNamed('/signin'); | ||
34 | - Navigator.push( | ||
35 | - context, | ||
36 | - PageTransition( | ||
37 | - type: PageTransitionType.rightToLeft, | ||
38 | - child: SignInPage())); | ||
39 | - }, | ||
40 | - child: Text('Sign In', style: contrastText), | ||
41 | - ) | ||
42 | - ], | ||
43 | - ), | ||
44 | - body: ListView( | ||
45 | - shrinkWrap: true, | ||
46 | - children: <Widget>[ | ||
47 | - Container( | ||
48 | - padding: EdgeInsets.only(left: 18, right: 18), | ||
49 | - child: Stack( | ||
50 | - children: <Widget>[ | ||
51 | - Column( | ||
52 | - mainAxisAlignment: MainAxisAlignment.start, | ||
53 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
54 | - children: <Widget>[ | ||
55 | - Text('Welcome to Fryo!', style: h3), | ||
56 | - Text('Let\'s get started', style: taglineText), | ||
57 | - fryoTextInput('Username'), | ||
58 | - fryoTextInput('Full Name'), | ||
59 | - fryoEmailInput('Email Address'), | ||
60 | - fryoPasswordInput('Password') | ||
61 | - ], | ||
62 | - ), | ||
63 | - Positioned( | ||
64 | - bottom: 15, | ||
65 | - right: -15, | ||
66 | - child: FlatButton( | ||
67 | - onPressed: () { | ||
68 | - Navigator.push( | ||
69 | - context, | ||
70 | - PageTransition( | ||
71 | - type: PageTransitionType.rightToLeft, | ||
72 | - child: DashBoard())); | ||
73 | - }, | ||
74 | - color: primaryColor, | ||
75 | - padding: EdgeInsets.all(13), | ||
76 | - shape: CircleBorder(), | ||
77 | - child: Icon(Icons.arrow_forward, color: white), | ||
78 | - ), | ||
79 | - ) | ||
80 | - ], | ||
81 | - ), | ||
82 | - height: 360, | ||
83 | - width: double.infinity, | ||
84 | - decoration: authPlateDecoration, | ||
85 | - ), | ||
86 | - ], | ||
87 | - )); | ||
88 | - } | ||
89 | -} |
... | @@ -67,6 +67,27 @@ packages: | ... | @@ -67,6 +67,27 @@ packages: |
67 | description: flutter | 67 | description: flutter |
68 | source: sdk | 68 | source: sdk |
69 | version: "0.0.0" | 69 | version: "0.0.0" |
70 | + intl: | ||
71 | + dependency: transitive | ||
72 | + description: | ||
73 | + name: intl | ||
74 | + url: "https://pub.dartlang.org" | ||
75 | + source: hosted | ||
76 | + version: "0.16.1" | ||
77 | + logging: | ||
78 | + dependency: transitive | ||
79 | + description: | ||
80 | + name: logging | ||
81 | + url: "https://pub.dartlang.org" | ||
82 | + source: hosted | ||
83 | + version: "0.11.4" | ||
84 | + mailer: | ||
85 | + dependency: "direct main" | ||
86 | + description: | ||
87 | + name: mailer | ||
88 | + url: "https://pub.dartlang.org" | ||
89 | + source: hosted | ||
90 | + version: "3.3.0" | ||
70 | matcher: | 91 | matcher: |
71 | dependency: transitive | 92 | dependency: transitive |
72 | description: | 93 | description: |
... | @@ -81,6 +102,13 @@ packages: | ... | @@ -81,6 +102,13 @@ packages: |
81 | url: "https://pub.dartlang.org" | 102 | url: "https://pub.dartlang.org" |
82 | source: hosted | 103 | source: hosted |
83 | version: "1.3.0-nullsafety.3" | 104 | version: "1.3.0-nullsafety.3" |
105 | + mime: | ||
106 | + dependency: transitive | ||
107 | + description: | ||
108 | + name: mime | ||
109 | + url: "https://pub.dartlang.org" | ||
110 | + source: hosted | ||
111 | + version: "0.9.7" | ||
84 | page_transition: | 112 | page_transition: |
85 | dependency: "direct main" | 113 | dependency: "direct main" |
86 | description: | 114 | description: |
... | @@ -95,6 +123,13 @@ packages: | ... | @@ -95,6 +123,13 @@ packages: |
95 | url: "https://pub.dartlang.org" | 123 | url: "https://pub.dartlang.org" |
96 | source: hosted | 124 | source: hosted |
97 | version: "1.8.0-nullsafety.1" | 125 | version: "1.8.0-nullsafety.1" |
126 | + pedantic: | ||
127 | + dependency: transitive | ||
128 | + description: | ||
129 | + name: pedantic | ||
130 | + url: "https://pub.dartlang.org" | ||
131 | + source: hosted | ||
132 | + version: "1.9.2" | ||
98 | sky_engine: | 133 | sky_engine: |
99 | dependency: transitive | 134 | dependency: transitive |
100 | description: flutter | 135 | description: flutter | ... | ... |
-
Please register or login to post a comment