feat: 新增寄送驗證碼前 email 驗證
This commit is contained in:
@@ -4,6 +4,7 @@ import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'package:mailer/mailer.dart';
|
||||
import 'package:mailer/smtp_server.dart';
|
||||
import 'package:validators/validators.dart' as validator;
|
||||
|
||||
void main() {
|
||||
runApp(MaterialApp(
|
||||
@@ -100,6 +101,11 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||
SnackBar(content: Text('請輸入電子信箱地址')),
|
||||
);
|
||||
return;
|
||||
} else if (!validator.isEmail(email)) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('請輸入正確的電子信箱')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
_generatedCode = _generateVerificationCode();
|
||||
|
||||
Reference in New Issue
Block a user