This commit is contained in:
2026-07-12 04:33:48 +08:00
parent f8a90ad305
commit e7ce0f7bae
151 changed files with 2765 additions and 2947 deletions

View File

@@ -1,5 +1,5 @@
import 'package:countdown/countdown.dart';
import '../../vendor/countdown/countdown.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:fluttertoast/fluttertoast.dart';
@@ -12,7 +12,7 @@ import '../../utils/http_util.dart';
import '../../utils/utils.dart';
class MobileForgotPassword extends StatefulWidget {
const MobileForgotPassword({Key key}) : super(key: key);
const MobileForgotPassword({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {
@@ -28,9 +28,9 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
bool usernameEnable = true;
final codeController = TextEditingController();
bool enableGetCode;
String getCodeText;
bool canRegister;
bool enableGetCode = false;
String? getCodeText;
bool canRegister = false;
var countDownListener;
@@ -90,8 +90,8 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
fontSize: 18.0
),
autofocus: true,
validator: (String value) {
if (value.trim().isEmpty) {
validator: (String? value) {
if (value == null || value.trim().isEmpty) {
return S.of(context).mobile_or_email_is_required;
}
return null;
@@ -158,7 +158,7 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
borderRadius: BorderRadius.all(Radius.circular(10.0)),
),
child: Text(
getCodeText,
'${getCodeText}',
style: TextStyle(
color: enableGetCode ? Colors.black87 : Colors.black26,
fontSize: 12.0
@@ -173,8 +173,8 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
style: TextStyle(
fontSize: 18.0
),
validator: (String value) {
if (value.trim().isEmpty) {
validator: (String? value) {
if (value == null || value.trim().isEmpty) {
return S.of(context).verification_code_is_required;
}
return null;
@@ -206,7 +206,7 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
alignment: Alignment.centerRight,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).primaryColor,
),
child: Text(
S.of(context).verify,
@@ -239,8 +239,8 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
}
void register() {
final FormState form = _formKey.currentState;
if (form.validate()) {
final FormState? form = _formKey.currentState;
if (form != null && form.validate()) {
HttpUtil.httpPost('v1/users', (response) {
Routes.router.navigateTo(context, '/reset-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true);
},