104 lines
3.1 KiB
Dart
104 lines
3.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/app_settings/app_colors.dart';
|
|
import 'package:star_lock/mine/mine/safeVerify/safeVerify_logic.dart';
|
|
import 'package:star_lock/tools/submitBtn.dart';
|
|
import 'package:star_lock/tools/titleAppBar.dart';
|
|
import 'package:star_lock/translations/trans_lib.dart';
|
|
|
|
class SafeVerifyPage extends StatefulWidget {
|
|
const SafeVerifyPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<SafeVerifyPage> createState() => _SafeVerifyPageState();
|
|
}
|
|
|
|
class _SafeVerifyPageState extends State<SafeVerifyPage> {
|
|
final logic = Get.put(SafeVerifyLogic());
|
|
final state = Get.find<SafeVerifyLogic>().state;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
backgroundColor: const Color(0xFFFFFFFF),
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.safeVerify!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: safeVerifyColumn());
|
|
}
|
|
|
|
Widget safeVerifyColumn() {
|
|
return Column(
|
|
children: [
|
|
SizedBox(
|
|
height: 60.h,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 60.w, right: 60.w),
|
|
height: 60.h,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white, borderRadius: BorderRadius.circular(30.w)),
|
|
child: TextField(
|
|
//输入框一行
|
|
maxLines: 1,
|
|
controller: state.codeController,
|
|
onChanged: (value) {
|
|
logic.checkNext(state.codeController);
|
|
},
|
|
autofocus: false,
|
|
decoration: InputDecoration(
|
|
contentPadding:
|
|
const EdgeInsets.only(left: 5, top: -8, bottom: 6),
|
|
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
|
hintStyle: TextStyle(fontSize: 22.sp, height: 1.0),
|
|
//不需要输入框下划线
|
|
border: const OutlineInputBorder(),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 30.h,
|
|
),
|
|
Obx(() => SizedBox(
|
|
width: 200.w,
|
|
child: SubmitBtn(
|
|
btnName: state.btnText.value,
|
|
onClick: () {
|
|
logic.sendValidationCode();
|
|
},
|
|
),
|
|
)),
|
|
SizedBox(
|
|
height: 60.h,
|
|
),
|
|
Obx(() => Padding(
|
|
padding: EdgeInsets.only(left: 60.w, right: 60.w),
|
|
child: Text(
|
|
'请点击获取验证码,验证码将发送到${state.accountStr.value}',
|
|
style: TextStyle(
|
|
color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
|
),
|
|
)),
|
|
SizedBox(
|
|
height: 120.h,
|
|
),
|
|
Obx(() => SubmitBtn(
|
|
btnName: '验证',
|
|
isDisabled: state.canSub.value,
|
|
onClick: () {
|
|
logic.deleteAccountRequest();
|
|
},
|
|
))
|
|
],
|
|
);
|
|
}
|
|
}
|