고원빈

[frontend] 회원 정보 수정 page 구현

1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter/services.dart'; 2 import 'package:flutter/services.dart';
3 -import '../../shared/colors.dart'; 3 +import 'package:flutter_application_1/src/screens/SettingPage.dart';
4 -import 'package:flutter_screenutil/flutter_screenutil.dart';
5 4
6 class InformationModify extends StatefulWidget { 5 class InformationModify extends StatefulWidget {
7 @override 6 @override
...@@ -9,16 +8,192 @@ class InformationModify extends StatefulWidget { ...@@ -9,16 +8,192 @@ class InformationModify extends StatefulWidget {
9 } 8 }
10 9
11 class _InformationModifyState extends State<InformationModify> { 10 class _InformationModifyState extends State<InformationModify> {
11 + final passwordController = TextEditingController();
12 + final passwordValidController = TextEditingController();
13 + final medicineNameController = TextEditingController();
14 + final medicineFactureController = TextEditingController();
15 + bool _validate = false;
16 + int userRole = 0;
17 +
18 + // Initially password is obscure
19 + bool passwordVisible = false;
20 + bool passwordValidationVisible = true;
21 +
12 Widget build(BuildContext context) { 22 Widget build(BuildContext context) {
13 - return MaterialApp( 23 + final Size size = MediaQuery.of(context).size;
14 - title: 'Welcome to Flutter', 24 + return Scaffold(
15 - home: Scaffold( 25 + appBar: AppBar(
16 - appBar: AppBar( 26 + iconTheme: IconThemeData(color: Colors.black),
17 - title: Text('Welcome to Flutter'), 27 + backgroundColor: Colors.white,
18 - ), 28 + title: Text(
19 - body: Center( 29 + 'Smart Medicine Box',
20 - child: Text('약병 정보 변경 작업 구역'), 30 + style: TextStyle(
31 + color: Colors.black,
32 + fontSize: 20,
33 + fontFamily: 'Noto',
34 + fontWeight: FontWeight.bold),
21 ), 35 ),
36 + actions: [
37 + IconButton(
38 + icon: Icon(
39 + Icons.settings,
40 + color: Colors.black,
41 + ),
42 + onPressed: () {
43 + Navigator.push(
44 + context,
45 + MaterialPageRoute(
46 + builder: (BuildContext context) => SettingPage(),
47 + ));
48 + },
49 + )
50 + ],
51 + ),
52 + body: ListView(
53 + children: <Widget>[
54 + Container(
55 + height: size.height * 0.9,
56 + margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
57 + padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
58 + child: Column(
59 + children: <Widget>[
60 + Container(
61 + padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
62 + height: size.height * 0.08,
63 + width: size.width,
64 + child: Center(
65 + child: Text(
66 + '회원 정보 수정',
67 + textAlign: TextAlign.center,
68 + textScaleFactor: 1.0,
69 + style: TextStyle(
70 + color: Colors.black,
71 + fontSize: 32,
72 + fontFamily: 'NotoSansKR',
73 + fontWeight: FontWeight.w700),
74 + ),
75 + ),
76 + ),
77 + MediaQuery(
78 + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
79 + child: Container(
80 + height: size.height * 0.6,
81 + child: Padding(
82 + padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
83 + child: new Column(
84 + children: <Widget>[
85 + SizedBox(height: 15),
86 + Container(
87 + height: size.height * 0.091,
88 + padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
89 + child: Container(
90 + width: size.width * 0.85,
91 + padding: const EdgeInsets.fromLTRB(5, 16, 5, 3),
92 + decoration: BoxDecoration(
93 + color: Color(0xffBDBDBD),
94 + border: Border.all(),
95 + borderRadius:
96 + BorderRadius.all(Radius.circular(5))),
97 + child: Text(
98 + 'test@naver.com',
99 + textScaleFactor: 1.0,
100 + style: TextStyle(
101 + color: Colors.black,
102 + fontSize: 18,
103 + fontFamily: 'NotoSansKR',
104 + ),
105 + ),
106 + ),
107 + ),
108 + SizedBox(height: 15),
109 + Container(
110 + height: size.height * 0.13,
111 + padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
112 + child: TextFormField(
113 + keyboardType: TextInputType.text,
114 + controller: passwordController,
115 + obscureText:
116 + !passwordVisible, //This will obscure text dynamically
117 + decoration: InputDecoration(
118 + border: OutlineInputBorder(
119 + borderSide:
120 + BorderSide(color: Colors.black)),
121 + labelText: '비밀번호',
122 + helperText: '비밀번호를 입력해주세요',
123 + // Here is key idea
124 + suffixIcon: IconButton(
125 + icon: Icon(
126 + // Based on passwordVisible state choose the icon
127 + passwordVisible
128 + ? Icons.visibility
129 + : Icons.visibility_off,
130 + color: Theme.of(context).primaryColorDark,
131 + ),
132 + onPressed: () {
133 + // Update the state i.e. toogle the state of passwordVisible variable
134 + setState(() {
135 + passwordVisible = !passwordVisible;
136 + });
137 + },
138 + ),
139 + ),
140 + ),
141 + ),
142 + Container(
143 + height: size.height * 0.13,
144 + padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
145 + child: TextFormField(
146 + keyboardType: TextInputType.text,
147 + controller: medicineNameController,
148 + decoration: InputDecoration(
149 + border: OutlineInputBorder(),
150 + labelText: '약 이름',
151 + helperText: '약의 이름을 읿력하세요',
152 + ),
153 + ),
154 + ),
155 + Container(
156 + height: size.height * 0.13,
157 + padding: const EdgeInsets.fromLTRB(5, 10, 5, 5),
158 + child: TextFormField(
159 + keyboardType: TextInputType.text,
160 + controller: medicineFactureController,
161 + decoration: InputDecoration(
162 + border: OutlineInputBorder(),
163 + labelText: '약 제조사 이름',
164 + helperText: '약 제조사의 이름을 읿력하세요',
165 + ),
166 + ),
167 + ),
168 + ],
169 + ),
170 + ),
171 + ),
172 + ),
173 + Container(
174 + height: 100,
175 + width: size.width * 0.7,
176 + padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
177 + child: RaisedButton(
178 + onPressed: () async {},
179 + shape: RoundedRectangleBorder(
180 + borderRadius: new BorderRadius.circular(20.0),
181 + side: BorderSide(color: Colors.blue)),
182 + color: Color(0xff1674f6),
183 + child: Text(
184 + '회원 정보 수정',
185 + textScaleFactor: 1.0,
186 + style: TextStyle(
187 + fontSize: 16,
188 + color: Colors.white,
189 + fontWeight: FontWeight.bold),
190 + ),
191 + ),
192 + )
193 + ],
194 + ),
195 + ),
196 + ],
22 ), 197 ),
23 ); 198 );
24 } 199 }
......
...@@ -57,7 +57,7 @@ class _SignUpLocalState extends State<SignUpLocal> { ...@@ -57,7 +57,7 @@ class _SignUpLocalState extends State<SignUpLocal> {
57 MediaQuery( 57 MediaQuery(
58 data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), 58 data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
59 child: Container( 59 child: Container(
60 - height: size.height * 0.8, 60 + height: size.height * 0.6,
61 child: Padding( 61 child: Padding(
62 padding: const EdgeInsets.fromLTRB(20, 5, 20, 20), 62 padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
63 child: new Column( 63 child: new Column(
...@@ -188,7 +188,7 @@ class _SignUpLocalState extends State<SignUpLocal> { ...@@ -188,7 +188,7 @@ class _SignUpLocalState extends State<SignUpLocal> {
188 Padding( 188 Padding(
189 padding: const EdgeInsets.fromLTRB(70, 0, 70, 0), 189 padding: const EdgeInsets.fromLTRB(70, 0, 70, 0),
190 child: Text( 190 child: Text(
191 - '회원 가입시, 이용 관 및 개인정보 처리 방침에 동의하는 것으로 간주합니다..', 191 + '회원 가입시, 이용 관 및 개인정보 처리 방침에 동의하는 것으로 간주합니다..',
192 style: TextStyle(fontSize: 12, color: Color(0xff747474)), 192 style: TextStyle(fontSize: 12, color: Color(0xff747474)),
193 textAlign: TextAlign.center, 193 textAlign: TextAlign.center,
194 ), 194 ),
......