|
@@ -5,6 +5,8 @@ import 'package:domain/repository/auth_repository.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
|
import 'package:plugin_basic/dialog/verify_code_view_model.dart';
|
|
|
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
|
+import 'package:shared/utils/util.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'dart:ui';
|
|
@@ -38,8 +40,7 @@ class VerifyCodeDialog extends HookConsumerWidget {
|
|
|
Future.microtask(() {
|
|
|
viewModel.fetchCode();
|
|
|
});
|
|
|
- return () {
|
|
|
- };
|
|
|
+ return () {};
|
|
|
}, []);
|
|
|
|
|
|
return Column(
|
|
@@ -122,9 +123,14 @@ class VerifyCodeDialog extends HookConsumerWidget {
|
|
|
cursorColor: context.appColors.authFiledText,
|
|
|
margin: const EdgeInsets.only(right: 5),
|
|
|
onSubmit: (formKey, value) {
|
|
|
- state.focusNode.unfocus();
|
|
|
- confirmAction.call(state.key, state.textEditingController.text.toString());
|
|
|
- onCancel();
|
|
|
+ String? code = state.textEditingController.text.toString();
|
|
|
+ if (Utils.isNotEmpty(code)) {
|
|
|
+ state.focusNode.unfocus();
|
|
|
+ confirmAction.call(state.key, code);
|
|
|
+ onCancel();
|
|
|
+ } else {
|
|
|
+ ToastEngine.show("Enter Code");
|
|
|
+ }
|
|
|
},
|
|
|
),
|
|
|
).expanded(),
|
|
@@ -148,9 +154,14 @@ class VerifyCodeDialog extends HookConsumerWidget {
|
|
|
children: [
|
|
|
InkWell(
|
|
|
onTap: () async {
|
|
|
- state.focusNode.unfocus();
|
|
|
- confirmAction.call(state.key, state.textEditingController.text.toString());
|
|
|
- onCancel();
|
|
|
+ String? code = state.textEditingController.text.toString();
|
|
|
+ if (Utils.isNotEmpty(code)) {
|
|
|
+ state.focusNode.unfocus();
|
|
|
+ confirmAction.call(state.key, code);
|
|
|
+ onCancel();
|
|
|
+ } else {
|
|
|
+ ToastEngine.show("Enter Code");
|
|
|
+ }
|
|
|
},
|
|
|
child: MyTextView(
|
|
|
S.current.get_verification_code,
|
|
@@ -170,8 +181,9 @@ class VerifyCodeDialog extends HookConsumerWidget {
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
- ).constrained(width: 300)
|
|
|
- //跟随软键盘滚动,适配居中于剩余的空间
|
|
|
+ )
|
|
|
+ .constrained(width: 300)
|
|
|
+ //跟随软键盘滚动,适配居中于剩余的空间
|
|
|
.padding(bottom: MediaQuery.of(context).viewInsets.bottom);
|
|
|
}
|
|
|
|