Showing
6 changed files
with
30 additions
and
65 deletions
... | @@ -5,7 +5,6 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; | ... | @@ -5,7 +5,6 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; |
5 | 5 | ||
6 | Future main() async { | 6 | Future main() async { |
7 | await DotEnv().load('.env'); | 7 | await DotEnv().load('.env'); |
8 | - | ||
9 | runApp(MyApp()); | 8 | runApp(MyApp()); |
10 | } | 9 | } |
11 | 10 | ||
... | @@ -14,7 +13,7 @@ class MyApp extends StatelessWidget { | ... | @@ -14,7 +13,7 @@ class MyApp extends StatelessWidget { |
14 | @override | 13 | @override |
15 | Widget build(BuildContext context) { | 14 | Widget build(BuildContext context) { |
16 | return MaterialApp( | 15 | return MaterialApp( |
17 | - title: 'Flutter Demo', | 16 | + title: 'SMART MEDICINE BOX', |
18 | theme: ThemeData( | 17 | theme: ThemeData( |
19 | primarySwatch: Colors.blue, | 18 | primarySwatch: Colors.blue, |
20 | ), | 19 | ), | ... | ... |
... | @@ -6,9 +6,7 @@ import './Register/SignInPage.dart'; | ... | @@ -6,9 +6,7 @@ import './Register/SignInPage.dart'; |
6 | import 'Register/SignUpLocal.dart'; | 6 | import 'Register/SignUpLocal.dart'; |
7 | 7 | ||
8 | class HomePage extends StatefulWidget { | 8 | class HomePage extends StatefulWidget { |
9 | - final String pageTitle; | 9 | + HomePage({Key key}) : super(key: key); |
10 | - int screenCount = 0; | ||
11 | - HomePage({Key key, this.pageTitle}) : super(key: key); | ||
12 | 10 | ||
13 | @override | 11 | @override |
14 | _HomePageState createState() => _HomePageState(); | 12 | _HomePageState createState() => _HomePageState(); |
... | @@ -18,8 +16,6 @@ class HomePage extends StatefulWidget { | ... | @@ -18,8 +16,6 @@ class HomePage extends StatefulWidget { |
18 | class _HomePageState extends State<HomePage> { | 16 | class _HomePageState extends State<HomePage> { |
19 | @override | 17 | @override |
20 | void initState() { | 18 | void initState() { |
21 | - SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); | ||
22 | - | ||
23 | super.initState(); | 19 | super.initState(); |
24 | } | 20 | } |
25 | 21 | ||
... | @@ -27,9 +23,6 @@ class _HomePageState extends State<HomePage> { | ... | @@ -27,9 +23,6 @@ class _HomePageState extends State<HomePage> { |
27 | Widget build(BuildContext context) { | 23 | Widget build(BuildContext context) { |
28 | final Size size = MediaQuery.of(context).size; | 24 | final Size size = MediaQuery.of(context).size; |
29 | 25 | ||
30 | - ScreenUtil.instance = ScreenUtil(width: size.width, height: size.height) | ||
31 | - ..init(context); | ||
32 | - | ||
33 | return Scaffold( | 26 | return Scaffold( |
34 | body: GestureDetector( | 27 | body: GestureDetector( |
35 | child: Container( | 28 | child: Container( |
... | @@ -88,11 +81,12 @@ class _HomePageState extends State<HomePage> { | ... | @@ -88,11 +81,12 @@ class _HomePageState extends State<HomePage> { |
88 | padding: EdgeInsets.fromLTRB(0, 5, 0, 5), | 81 | padding: EdgeInsets.fromLTRB(0, 5, 0, 5), |
89 | onPressed: () { | 82 | onPressed: () { |
90 | Navigator.push( | 83 | Navigator.push( |
91 | - context, | 84 | + context, |
92 | - MaterialPageRoute( | 85 | + MaterialPageRoute( |
93 | - builder: (BuildContext context) => | 86 | + builder: (BuildContext context) => |
94 | - SignInPage(), | 87 | + SignInPage(), |
95 | - )); | 88 | + ), |
89 | + ); | ||
96 | }, | 90 | }, |
97 | child: Text( | 91 | child: Text( |
98 | '로그인', | 92 | '로그인', |
... | @@ -117,11 +111,12 @@ class _HomePageState extends State<HomePage> { | ... | @@ -117,11 +111,12 @@ class _HomePageState extends State<HomePage> { |
117 | padding: EdgeInsets.fromLTRB(0, 25, 0, 15), | 111 | padding: EdgeInsets.fromLTRB(0, 25, 0, 15), |
118 | onPressed: () { | 112 | onPressed: () { |
119 | Navigator.push( | 113 | Navigator.push( |
120 | - context, | 114 | + context, |
121 | - MaterialPageRoute( | 115 | + MaterialPageRoute( |
122 | - builder: (BuildContext context) => | 116 | + builder: (BuildContext context) => |
123 | - SignUpLocal(), | 117 | + SignUpLocal(), |
124 | - )); | 118 | + ), |
119 | + ); | ||
125 | }, | 120 | }, |
126 | child: Text( | 121 | child: Text( |
127 | '회원 가입', | 122 | '회원 가입', | ... | ... |
... | @@ -42,6 +42,7 @@ class _SignInPageState extends State<SignInPage> { | ... | @@ -42,6 +42,7 @@ class _SignInPageState extends State<SignInPage> { |
42 | Map<String, dynamic> data = jsonDecode(response.body); | 42 | Map<String, dynamic> data = jsonDecode(response.body); |
43 | user = User.fromJson(data); | 43 | user = User.fromJson(data); |
44 | UserSecureStorage.setUserToken(user.token); | 44 | UserSecureStorage.setUserToken(user.token); |
45 | + UserSecureStorage.setUserId(user.userId); | ||
45 | return "로그인 성공"; | 46 | return "로그인 성공"; |
46 | } else if (response.statusCode == 400) { | 47 | } else if (response.statusCode == 400) { |
47 | return "올바르지 않은 아이디 및 패스워드"; | 48 | return "올바르지 않은 아이디 및 패스워드"; |
... | @@ -228,8 +229,6 @@ class _SignInPageState extends State<SignInPage> { | ... | @@ -228,8 +229,6 @@ class _SignInPageState extends State<SignInPage> { |
228 | }); | 229 | }); |
229 | } else { | 230 | } else { |
230 | if (saveMessage == "로그인 성공") { | 231 | if (saveMessage == "로그인 성공") { |
231 | - UserSecureStorage.setUserToken( | ||
232 | - user.token); | ||
233 | var result = await getHubList(); | 232 | var result = await getHubList(); |
234 | if (result == "Not Found") { | 233 | if (result == "Not Found") { |
235 | Navigator.push( | 234 | Navigator.push( |
... | @@ -240,15 +239,13 @@ class _SignInPageState extends State<SignInPage> { | ... | @@ -240,15 +239,13 @@ class _SignInPageState extends State<SignInPage> { |
240 | RegisterHub(modify_hub: 0), | 239 | RegisterHub(modify_hub: 0), |
241 | )); | 240 | )); |
242 | } else if (result == "get완료") { | 241 | } else if (result == "get완료") { |
243 | - UserSecureStorage.setUserId( | ||
244 | - user.userId); | ||
245 | Navigator.push( | 242 | Navigator.push( |
246 | - context, | 243 | + context, |
247 | - MaterialPageRoute( | 244 | + MaterialPageRoute( |
248 | - builder: (BuildContext | 245 | + builder: (BuildContext context) => |
249 | - context) => | 246 | + HubList(hublist: _hublist), |
250 | - HubList(hublist: _hublist), | 247 | + ), |
251 | - )); | 248 | + ); |
252 | } else {} | 249 | } else {} |
253 | } else { | 250 | } else { |
254 | print('Error'); | 251 | print('Error'); | ... | ... |
... | @@ -20,7 +20,7 @@ class _SignUpLocalState extends State<SignUpLocal> { | ... | @@ -20,7 +20,7 @@ class _SignUpLocalState extends State<SignUpLocal> { |
20 | 20 | ||
21 | // Initially password is obscure | 21 | // Initially password is obscure |
22 | bool passwordVisible = false; | 22 | bool passwordVisible = false; |
23 | - bool passwordValidationVisible = true; | 23 | + bool passwordValidationVisible = false; |
24 | 24 | ||
25 | Future<String> signup_Validate() async { | 25 | Future<String> signup_Validate() async { |
26 | http.Response response = await http.post( | 26 | http.Response response = await http.post( | ... | ... |
... | @@ -175,35 +175,6 @@ class _SettingPageState extends State<SettingPage> { | ... | @@ -175,35 +175,6 @@ class _SettingPageState extends State<SettingPage> { |
175 | borderRadius: BorderRadius.circular(50)), | 175 | borderRadius: BorderRadius.circular(50)), |
176 | ), | 176 | ), |
177 | ), | 177 | ), |
178 | - Container( | ||
179 | - padding: EdgeInsets.fromLTRB(0, 20, 0, 20), | ||
180 | - width: size.width * 0.8, | ||
181 | - height: size.height * 0.13, | ||
182 | - margin: EdgeInsets.only(bottom: 0), | ||
183 | - child: FlatButton( | ||
184 | - height: size.height * 0.07, | ||
185 | - onPressed: () { | ||
186 | - Navigator.push( | ||
187 | - context, | ||
188 | - MaterialPageRoute( | ||
189 | - builder: (BuildContext context) => | ||
190 | - DEVInformation(), | ||
191 | - )); | ||
192 | - }, | ||
193 | - child: Text( | ||
194 | - '개발자 정보', | ||
195 | - textScaleFactor: 1.0, | ||
196 | - style: TextStyle( | ||
197 | - color: Colors.white, | ||
198 | - fontSize: 24, | ||
199 | - fontFamily: 'Noto', | ||
200 | - fontWeight: FontWeight.bold), | ||
201 | - ), | ||
202 | - color: Color(0xff0B1E33), | ||
203 | - shape: RoundedRectangleBorder( | ||
204 | - borderRadius: BorderRadius.circular(50)), | ||
205 | - ), | ||
206 | - ), | ||
207 | ], | 178 | ], |
208 | ), | 179 | ), |
209 | ), | 180 | ), |
... | @@ -219,14 +190,17 @@ class _SettingPageState extends State<SettingPage> { | ... | @@ -219,14 +190,17 @@ class _SettingPageState extends State<SettingPage> { |
219 | unselectedFontSize: 14, | 190 | unselectedFontSize: 14, |
220 | currentIndex: 0, | 191 | currentIndex: 0, |
221 | onTap: (int index) => { | 192 | onTap: (int index) => { |
222 | - setState(() { | 193 | + setState( |
223 | - Navigator.push( | 194 | + () { |
195 | + Navigator.push( | ||
224 | context, | 196 | context, |
225 | MaterialPageRoute( | 197 | MaterialPageRoute( |
226 | builder: (BuildContext context) => | 198 | builder: (BuildContext context) => |
227 | DashBoard(pageNumber: index), | 199 | DashBoard(pageNumber: index), |
228 | - )); | 200 | + ), |
229 | - }) | 201 | + ); |
202 | + }, | ||
203 | + ) | ||
230 | }, | 204 | }, |
231 | items: [ | 205 | items: [ |
232 | BottomNavigationBarItem( | 206 | BottomNavigationBarItem( | ... | ... |
... | @@ -211,7 +211,7 @@ class _BottleModifyListState extends State<BottleModifyList> { | ... | @@ -211,7 +211,7 @@ class _BottleModifyListState extends State<BottleModifyList> { |
211 | context: context, | 211 | context: context, |
212 | builder: (BuildContext context) { | 212 | builder: (BuildContext context) { |
213 | return AlertDialog( | 213 | return AlertDialog( |
214 | - title: new Text('허브 삭제'), | 214 | + title: new Text('약병 삭제'), |
215 | content: new Text( | 215 | content: new Text( |
216 | _bottleList[index].bottleId.toString() + | 216 | _bottleList[index].bottleId.toString() + |
217 | '을 삭제 하시겠습니까?'), | 217 | '을 삭제 하시겠습니까?'), | ... | ... |
-
Please register or login to post a comment