app-starlock/lib/mine/minePersonInfo/minePersonInfoEditIphone/minePersonInfoEditIphone_page.dart
2024-05-18 09:37:50 +08:00

162 lines
6.1 KiB
Dart
Executable File

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 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();
late Timer _timer;
int _seconds = 60;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.iphone!.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!.changeIphoneTip!.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(
TranslationLoader.lanKeys!.countryAndRegion!.tr,
style: TextStyle(
fontSize: 22.sp,
fontWeight: FontWeight.w500))),
SizedBox(width: 20.w),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
"中国+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:
"${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.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: 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
? '${TranslationLoader.lanKeys!.getTip!.tr} ${TranslationLoader.lanKeys!.verificationCode!.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: TranslationLoader.lanKeys!.sure!.tr,
fontSize: 28.sp,
borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}),
],
),
));
}
}