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

186 lines
4.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/tools/submitBtn.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class RecipientInformationPage extends StatefulWidget {
const RecipientInformationPage({Key? key}) : super(key: key);
@override
State<RecipientInformationPage> createState() =>
_RecipientInformationPageState();
}
class _RecipientInformationPageState extends State<RecipientInformationPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
body: Column(
children: [
SizedBox(height: 150.h, child: _buildMainUI()),
SizedBox(
height: 20.h,
),
_buildAccoutRow(),
_buildBottomText(),
_buildNextBtn(),
Expanded(
child: SizedBox(
height: 64.h,
)),
_buildRemoveBadLockBtn(),
SizedBox(
height: 64.h,
)
],
),
);
}
Widget _buildMainUI() {
return ListView.separated(
itemCount: 2,
separatorBuilder: (context, index) {
return Divider(
height: 1,
indent: 20.w,
endIndent: 20.w,
color: AppColors.greyLineColor,
);
},
itemBuilder: (c, index) {
if (index == 0) {
return _electronicKeyItem(
'images/select_circle.png', "个人用户", () {});
} else {
return _electronicKeyItem(
'images/normal_circle.png', "好房管家", () {});
}
});
}
Widget _electronicKeyItem(
String leftIcon, String leftTitle, Function() action) {
return GestureDetector(
child: Container(
color: Colors.white,
height: 70.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 40.w,
),
GestureDetector(
child: Image.asset(
leftIcon,
width: 20.w,
height: 20.w,
),
),
SizedBox(
width: 16.w,
),
Text(
leftTitle,
style: TextStyle(fontSize: 24.sp),
)
],
),
),
onTap: () {},
);
}
Widget _buildAccoutRow() {
return Container(
height: 60.h,
color: Colors.white,
child: Row(
children: [
SizedBox(
width: 40.w,
),
Text(
'账号',
style:
TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp),
),
Expanded(
child: TextField(
textAlign: TextAlign.right,
keyboardType: TextInputType.text,
onChanged: (value) {},
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入手机号或email',
hintStyle: TextStyle(
color: AppColors.placeholderTextColor,
fontSize: ScreenUtil().setSp(22),
textBaseline: TextBaseline.alphabetic),
),
)),
SizedBox(
width: 20.w,
),
Image.asset(
'images/icon_addressBook.png',
width: 28.w,
height: 28.h,
),
SizedBox(
width: 40.w,
)
],
),
);
}
Widget _buildBottomText() {
return Padding(
padding: EdgeInsets.only(top: 20.h, bottom: 80.h),
child: Text(
'选中的智能锁将会转移到您输入的账号中,您将失去锁的管理权',
style:
TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor),
textAlign: TextAlign.left,
),
);
}
Widget _buildNextBtn() {
return SubmitBtn(btnName: '下一步', onClick: () {});
}
Widget _buildRemoveBadLockBtn() {
return Row(
children: [
const Expanded(child: SizedBox()),
TextButton(
onPressed: () {},
child: Text(
'移除坏锁',
style: TextStyle(
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
textAlign: TextAlign.end,
)),
SizedBox(
width: 10.h,
)
],
);
}
}