Daisy 76ceab6f34 1,星锁主界面UI更新
2,锁列表UI更新
3,侧边栏 个人信息模块UI更新
4,添加锁模块UI更新
5,我的-设置模块UI更新
6,新增“添加授权管理员”页面UI布局
2023-07-27 15:26:30 +08:00

118 lines
4.4 KiB
Dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/tf_loginInput.dart';
import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart';
class MinePersonInfoEditEmailPage extends StatefulWidget {
const MinePersonInfoEditEmailPage({Key? key}) : super(key: key);
@override
State<MinePersonInfoEditEmailPage> createState() =>
_MinePersonInfoEditEmailPageState();
}
class _MinePersonInfoEditEmailPageState
extends State<MinePersonInfoEditEmailPage> {
final TextEditingController _phoneController = TextEditingController();
final TextEditingController _codeController = TextEditingController();
late Timer _timer;
int _seconds = 60;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.email!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Container(
padding: EdgeInsets.only(top: 10.h, left: 30.w, right: 30.w),
child: Column(
children: [
Container(
width: 1.sw,
padding: EdgeInsets.only(top: 5.h, bottom: 5.h),
child: Text(
TranslationLoader.lanKeys!.changeEmailTip!.tr,
style: TextStyle(fontSize: 20.sp),
)),
LoginInput(
controller: _phoneController,
isPwd: true,
leftWidget: const SizedBox(),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.email!.tr}",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
]),
SizedBox(height: 10.w),
Row(
children: [
Expanded(
child: LoginInput(
controller: _codeController,
isPwd: true,
leftWidget: const SizedBox(),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
]),
),
SizedBox(
width: 20.w,
),
GestureDetector(
child: Container(
width: 140.w,
// height: 60.h,
padding: EdgeInsets.all(8.h),
decoration: BoxDecoration(
color: AppColors.mainColor,
borderRadius: BorderRadius.circular(5)),
child: Center(
child: Text(
_seconds == 60
? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}'
: (_seconds < 10)
? '0$_seconds s'
: '$_seconds s',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 22.sp,
)),
),
),
onTap: () {
if (_seconds == 60) {
// _setVerify();
} else {
// Toast.show(msg: '正在获取验证码');
}
},
)
],
),
SizedBox(height: 50.w),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr,
fontSize: 28.sp,
borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}),
],
),
));
}
}