Compare commits
2 Commits
98bbd6b4b6
...
5730659982
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5730659982 | ||
|
|
494cdb1b55 |
|
|
@ -4,6 +4,7 @@ import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:mailer/mailer.dart';
|
import 'package:mailer/mailer.dart';
|
||||||
import 'package:mailer/smtp_server.dart';
|
import 'package:mailer/smtp_server.dart';
|
||||||
|
import 'package:validators/validators.dart' as validator;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MaterialApp(
|
runApp(MaterialApp(
|
||||||
|
|
@ -100,6 +101,11 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||||
SnackBar(content: Text('請輸入電子信箱地址')),
|
SnackBar(content: Text('請輸入電子信箱地址')),
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
} else if (!validator.isEmail(email)) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(content: Text('請輸入正確的電子信箱')),
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_generatedCode = _generateVerificationCode();
|
_generatedCode = _generateVerificationCode();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class LoginPage extends StatefulWidget {//ful會改變
|
||||||
class _LoginPageState extends State<LoginPage> {
|
class _LoginPageState extends State<LoginPage> {
|
||||||
final TextEditingController _emailController = TextEditingController();
|
final TextEditingController _emailController = TextEditingController();
|
||||||
final TextEditingController _ageController = TextEditingController();
|
final TextEditingController _ageController = TextEditingController();
|
||||||
|
bool _passwordNotVisible = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {//初始化
|
void initState() {//初始化
|
||||||
|
|
@ -116,9 +117,21 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
prefixIcon: Icon(Icons.lock_outlined),
|
prefixIcon: Icon(Icons.lock_outlined),
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(_passwordNotVisible
|
||||||
|
? Icons.visibility
|
||||||
|
: Icons.visibility_off),
|
||||||
|
onPressed: () {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
_passwordNotVisible = !_passwordNotVisible;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
labelText: '密碼',
|
labelText: '密碼',
|
||||||
),
|
),
|
||||||
obscureText: true,
|
obscureText: _passwordNotVisible,
|
||||||
),//密碼
|
),//密碼
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ dependencies:
|
||||||
webview_flutter: ^4.8.0
|
webview_flutter: ^4.8.0
|
||||||
persistent_bottom_nav_bar_v2: ^5.3.0
|
persistent_bottom_nav_bar_v2: ^5.3.0
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
|
validators: ^3.0.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user