159 lines
5.9 KiB
Dart
Executable File
159 lines
5.9 KiB
Dart
Executable File
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/src/services/text_formatter.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';
|
|
|
|
class MinePersonInfoEditIphonePage extends StatefulWidget {
|
|
const MinePersonInfoEditIphonePage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MinePersonInfoEditIphonePage> createState() =>
|
|
_MinePersonInfoEditIphonePageState();
|
|
}
|
|
|
|
class _MinePersonInfoEditIphonePageState extends State<MinePersonInfoEditIphonePage> {
|
|
final TextEditingController _phoneController = TextEditingController();
|
|
final TextEditingController _codeController = TextEditingController();
|
|
final int _seconds = 60;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(
|
|
barTitle: '手机'.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(
|
|
'找回密码和登录新设备时,可通过绑定的手机验证'.tr,
|
|
style: TextStyle(fontSize: 20.sp),
|
|
)),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pushNamed(context, Routers.selectCountryRegionPage);
|
|
},
|
|
child: Container(
|
|
height: 70.h,
|
|
// color: Colors.red,
|
|
// padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w),
|
|
child: Row(
|
|
children: [
|
|
SizedBox(width: 5.w),
|
|
Expanded(
|
|
child: Text(
|
|
'国家/地区'.tr,
|
|
style: TextStyle(
|
|
fontSize: 22.sp,
|
|
fontWeight: FontWeight.w500))),
|
|
SizedBox(width: 20.w),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
Text(
|
|
'${'中国'.tr}+86',
|
|
textAlign: TextAlign.end,
|
|
style: TextStyle(
|
|
fontSize: 22.sp, fontWeight: FontWeight.w500),
|
|
)
|
|
],
|
|
),
|
|
SizedBox(width: 5.w),
|
|
Image.asset(
|
|
'images/icon_right.png',
|
|
width: 50.w,
|
|
height: 50.w,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
height: 0.5.h,
|
|
color: Colors.grey,
|
|
),
|
|
SizedBox(height: 10.w),
|
|
LoginInput(
|
|
controller: _phoneController,
|
|
isPwd: true,
|
|
leftWidget: const SizedBox(),
|
|
hintText:
|
|
'密码'.tr,
|
|
inputFormatters: const <TextInputFormatter>[
|
|
// LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
SizedBox(height: 10.w),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: LoginInput(
|
|
controller: _codeController,
|
|
isPwd: true,
|
|
leftWidget: const SizedBox(),
|
|
hintText:
|
|
'请输入验证码'.tr,
|
|
inputFormatters: const <TextInputFormatter>[
|
|
// LengthLimitingTextInputFormatter(20),
|
|
]),
|
|
),
|
|
SizedBox(
|
|
width: 20.w,
|
|
),
|
|
GestureDetector(
|
|
child: Container(
|
|
width: 180.w,
|
|
// height: 60.h,
|
|
padding: EdgeInsets.all(8.h),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.mainColor,
|
|
borderRadius: BorderRadius.circular(5)),
|
|
child: Center(
|
|
child: Text(
|
|
_seconds == 60
|
|
? '获取验证码'.tr
|
|
: (_seconds < 10)
|
|
? '0$_seconds s'
|
|
: '$_seconds s',
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 26.sp,
|
|
)),
|
|
),
|
|
),
|
|
onTap: () {
|
|
if (_seconds == 60) {
|
|
// _setVerify();
|
|
} else {
|
|
// Toast.show(msg: '正在获取验证码');
|
|
}
|
|
},
|
|
)
|
|
],
|
|
),
|
|
SizedBox(height: 50.w),
|
|
SubmitBtn(
|
|
btnName: '确定'.tr,
|
|
fontSize: 28.sp,
|
|
borderRadius: 20.w,
|
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
onClick: () {}),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|