199 lines
8.7 KiB
Dart
199 lines
8.7 KiB
Dart
import 'package:circle_app/common/colors/app_color.dart';
|
|
import 'package:circle_app/components/my_app_bar.dart';
|
|
import 'package:circle_app/util/util.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import 'logic.dart';
|
|
|
|
class Reset_pwdPage extends StatelessWidget {
|
|
Reset_pwdPage({Key? key}) : super(key: key);
|
|
|
|
final logic = Get.find<Reset_pwdLogic>();
|
|
final state = Get.find<Reset_pwdLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetBuilder<Reset_pwdLogic>(builder: (logic) {
|
|
|
|
return Stack(
|
|
children: [
|
|
Container(
|
|
width: Get.width,
|
|
height: Get.height,
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage(getBaseImage('home_back')),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
Scaffold(
|
|
backgroundColor: Colors.transparent,
|
|
resizeToAvoidBottomInset: false,
|
|
appBar: const MyAppBar(
|
|
centerTitle: '重置密码',
|
|
),
|
|
body: GestureDetector(
|
|
behavior: HitTestBehavior.opaque,
|
|
onTap: () {
|
|
FocusManager.instance.primaryFocus?.unfocus();
|
|
},
|
|
child: Container(
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
height: 40.sp,
|
|
margin: EdgeInsets.symmetric(horizontal: 16.sp,vertical: 10.sp),
|
|
|
|
// decoration: BoxDecoration(
|
|
// color: Color(0xff282733),
|
|
// borderRadius: BorderRadius.circular(8.sp)
|
|
// ),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
|
margin: EdgeInsets.only(right: 15.sp),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff282733),
|
|
borderRadius: BorderRadius.circular(8.sp)
|
|
),
|
|
child: TextFormField(
|
|
controller: logic.codeController,
|
|
|
|
decoration: const InputDecoration(
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
enabledBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
hintText: '请输入验证码',
|
|
hintStyle: TextStyle(color: Color(0xFFB7BECC)),
|
|
counterText: ''
|
|
),
|
|
maxLength: 6,
|
|
style: const TextStyle(color: Color(0xFFB7BECC)),
|
|
),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
logic.starDownTimer();
|
|
},
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
width: 76.sp,
|
|
height: 29.sp,
|
|
decoration: BoxDecoration(
|
|
color: logic.sendCodeBtn
|
|
? Colors.white30
|
|
: const Color(
|
|
0xff0AFCFF),
|
|
borderRadius:
|
|
BorderRadius.circular(
|
|
29.sp / 2)),
|
|
child: Text(
|
|
logic.sendCodeBtn
|
|
? '${logic.seconds}s'
|
|
: '获取验证码',
|
|
style: TextStyle(
|
|
color: logic.sendCodeBtn
|
|
? Colors.white
|
|
: Colors.black,
|
|
fontSize: 12.sp),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
height: 40.sp,
|
|
margin: EdgeInsets.symmetric(horizontal: 16.sp,vertical: 10.sp),
|
|
padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff282733),
|
|
borderRadius: BorderRadius.circular(8.sp)
|
|
),
|
|
child: TextFormField(
|
|
controller: logic.new_passwordController,
|
|
decoration: const InputDecoration(
|
|
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
enabledBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
hintText: '请输入6-12位新密码',
|
|
hintStyle: TextStyle(color: Color(0xFFB7BECC)),
|
|
counterText: ''
|
|
),
|
|
maxLength: 12,
|
|
style: const TextStyle(color: Color(0xFFB7BECC)),
|
|
),
|
|
),
|
|
Container(
|
|
height: 40.sp,
|
|
margin: EdgeInsets.symmetric(horizontal: 16.sp,vertical: 10.sp),
|
|
padding: EdgeInsets.symmetric(horizontal: 10.sp),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xff282733),
|
|
borderRadius: BorderRadius.circular(8.sp)
|
|
),
|
|
child: TextFormField(
|
|
controller: logic.config_passwordController,
|
|
decoration: const InputDecoration(
|
|
focusedBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
enabledBorder: UnderlineInputBorder(
|
|
borderSide: BorderSide(color: Colors.transparent),
|
|
),
|
|
hintText: '再次输入新密码',
|
|
hintStyle: TextStyle(color: Color(0xFFB7BECC)),
|
|
counterText: ''
|
|
),
|
|
maxLength: 12,
|
|
style: const TextStyle(color: Color(0xFFB7BECC)),
|
|
),
|
|
),
|
|
|
|
|
|
GestureDetector(
|
|
onTap: () {
|
|
logic.setPassword();
|
|
},
|
|
child: Container(
|
|
width: double.infinity,
|
|
margin: EdgeInsets.symmetric(horizontal: 97.sp,vertical: 10.sp),
|
|
height: 48.sp,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
gradient: AppColor.mainVerLinearGradient,
|
|
borderRadius: BorderRadius.circular(24.sp),
|
|
),
|
|
child: Text(
|
|
'确定',
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 18.sp,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)),
|
|
],
|
|
);
|
|
});
|
|
}
|
|
}
|