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 createState() => _MinePersonInfoEditEmailPageState(); } class _MinePersonInfoEditEmailPageState extends State { 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: () {}), ], ), )); } }