Compare commits
3 Commits
cf3abfc12b
...
7d06f83d38
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d06f83d38 | ||
|
|
c3533e6338 | ||
|
|
09d4346608 |
|
|
@ -139,7 +139,6 @@ class _PersonalInfoState extends State<PersonalInfo> {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error: $e');
|
print('Error: $e');
|
||||||
} finally {
|
} finally {
|
||||||
await conn.close();
|
|
||||||
await conn.close();
|
await conn.close();
|
||||||
print('finally儲存更新狀態:$_isEditing');
|
print('finally儲存更新狀態:$_isEditing');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,15 +176,16 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||||
String password = _passwordController.text;
|
String password = _passwordController.text;
|
||||||
|
|
||||||
var result = await conn.execute(
|
var result = await conn.execute(
|
||||||
'SELECT * FROM HomeLogin WHERE homeEmail = :email AND homePassword = :password',
|
'SELECT * FROM HomeLogin WHERE homeEmail = :email',
|
||||||
{'email': email, 'password': password},
|
{'email': email},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.rows.isNotEmpty) {
|
if (result.rows.isNotEmpty) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text('登入失敗:帳號或密碼錯誤')),
|
SnackBar(content: Text('註冊失敗:電子信箱已被使用,請嘗試更換電子信箱')),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// TODO: Phone Address is setting not null in database, remove it or setting default value
|
||||||
await conn.execute(
|
await conn.execute(
|
||||||
'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)',
|
'INSERT INTO HomeLogin (homeName, homeEmail, homePassword) VALUES (:name, :email, :password)',
|
||||||
{'name': name, 'email': email, 'password': password},
|
{'name': name, 'email': email, 'password': password},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user