2024-06-14 15:46:43 +08:00
|
|
|
|
|
2023-09-22 16:06:08 +08:00
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
import 'package:get/get.dart';
|
2024-06-14 15:46:43 +08:00
|
|
|
|
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_state.dart';
|
2023-09-22 16:06:08 +08:00
|
|
|
|
|
|
|
|
|
|
import '../../../../../app_settings/app_colors.dart';
|
|
|
|
|
|
import '../../../../../tools/titleAppBar.dart';
|
|
|
|
|
|
import '../recipientInformation/recipientInformation_entity.dart';
|
|
|
|
|
|
import 'selectBranch_logic.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class SelectBranchPage extends StatefulWidget {
|
|
|
|
|
|
const SelectBranchPage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
State<SelectBranchPage> createState() => _SelectBranchPageState();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _SelectBranchPageState extends State<SelectBranchPage> {
|
2024-06-14 15:46:43 +08:00
|
|
|
|
final SelectBranchLogic logic = Get.put(SelectBranchLogic());
|
|
|
|
|
|
final SelectBranchState state = Get.find<SelectBranchLogic>().state;
|
2023-09-22 16:06:08 +08:00
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
|
|
|
|
appBar: TitleAppBar(
|
2024-08-01 18:54:32 +08:00
|
|
|
|
barTitle: '接收人信息'.tr,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
haveBack: true,
|
|
|
|
|
|
backgroundColor: AppColors.mainColor,
|
|
|
|
|
|
),
|
|
|
|
|
|
body: Column(
|
2024-06-14 15:46:43 +08:00
|
|
|
|
children: <Widget>[
|
2023-09-22 16:06:08 +08:00
|
|
|
|
_buildTopView(),
|
2024-06-14 15:46:43 +08:00
|
|
|
|
SizedBox(height: 20.h),
|
2023-09-22 16:06:08 +08:00
|
|
|
|
Expanded(child: _buildMainUI()),
|
|
|
|
|
|
_buildNextBtn(),
|
2024-06-14 15:46:43 +08:00
|
|
|
|
SizedBox(height: 64.h)
|
2023-09-22 16:06:08 +08:00
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildTopView() {
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
height: 120.h,
|
|
|
|
|
|
width: ScreenUtil().screenWidth,
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2024-06-14 15:46:43 +08:00
|
|
|
|
children: <Widget>[
|
2023-09-22 16:06:08 +08:00
|
|
|
|
Padding(
|
|
|
|
|
|
padding: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 16.h),
|
|
|
|
|
|
child: Text(
|
2024-06-14 15:46:43 +08:00
|
|
|
|
'公寓'.tr,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
style: TextStyle(fontSize: 28.sp),
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
Obx(() => Padding(
|
|
|
|
|
|
padding: EdgeInsets.only(left: 40.w),
|
2024-06-14 15:46:43 +08:00
|
|
|
|
child: Text('管理员'.tr + ':${state.receiverNumber.value}',
|
2023-09-22 16:06:08 +08:00
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: AppColors.darkGrayTextColor, fontSize: 24.sp)),
|
|
|
|
|
|
))
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildMainUI() {
|
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
|
itemCount: 1,
|
2024-06-14 15:46:43 +08:00
|
|
|
|
separatorBuilder: (BuildContext context, int index) {
|
2023-09-22 16:06:08 +08:00
|
|
|
|
return Divider(
|
|
|
|
|
|
height: 1,
|
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
2024-06-14 15:46:43 +08:00
|
|
|
|
itemBuilder: (BuildContext c, int index) {
|
2024-08-21 14:12:15 +08:00
|
|
|
|
return _electronicKeyItem('images/normal_circle.png', '', () {});
|
2023-09-22 16:06:08 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
2024-06-14 15:46:43 +08:00
|
|
|
|
children: <Widget>[
|
2023-09-22 16:06:08 +08:00
|
|
|
|
SizedBox(
|
|
|
|
|
|
width: 40.w,
|
|
|
|
|
|
),
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
|
leftIcon,
|
|
|
|
|
|
width: 16,
|
|
|
|
|
|
height: 16,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
width: 16.w,
|
|
|
|
|
|
),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
leftTitle,
|
|
|
|
|
|
style: TextStyle(fontSize: 24.sp),
|
|
|
|
|
|
)
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
onTap: () {},
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildNextBtn() {
|
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
color: AppColors.mainColor,
|
|
|
|
|
|
width: ScreenUtil().screenWidth,
|
|
|
|
|
|
height: 64.h,
|
|
|
|
|
|
child: TextButton(
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
// showCupertinoAlertDialog(context, RecipientInformationData());
|
|
|
|
|
|
},
|
|
|
|
|
|
child: Text(
|
2024-06-14 15:46:43 +08:00
|
|
|
|
'下一步'.tr,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: Colors.white),
|
|
|
|
|
|
)),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void showCupertinoAlertDialog(BuildContext context, RecipientInformationData recipientInformationData) {
|
|
|
|
|
|
showGeneralDialog(
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
barrierColor: Colors.black.withOpacity(.5),
|
|
|
|
|
|
barrierDismissible: true,
|
|
|
|
|
|
barrierLabel: '',
|
|
|
|
|
|
transitionDuration: const Duration(milliseconds: 200),
|
|
|
|
|
|
transitionBuilder: (BuildContext context,
|
|
|
|
|
|
Animation<double> animation,
|
|
|
|
|
|
Animation<double> secondaryAnimation,
|
|
|
|
|
|
Widget child) {
|
|
|
|
|
|
return ScaleTransition(scale: animation, child: child);
|
|
|
|
|
|
},
|
|
|
|
|
|
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
|
|
|
|
|
|
// recipientInformationData.nickname = "张三张三张三";
|
|
|
|
|
|
return Center(
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
width: 400.w,
|
|
|
|
|
|
height: 370.h,
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
child: Column(
|
2024-06-14 15:46:43 +08:00
|
|
|
|
children: <Widget>[
|
2023-09-22 16:06:08 +08:00
|
|
|
|
SizedBox(height: 20.h),
|
2024-08-21 14:12:15 +08:00
|
|
|
|
Text('转移确认'.tr, style: TextStyle(fontSize: 24.sp)),
|
2023-09-22 16:06:08 +08:00
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
|
|
Image.asset('images/icon_lockGroup_item.png', width: 70.h, height: 70.h, fit: BoxFit.fill),
|
|
|
|
|
|
SizedBox(height: 15.h),
|
|
|
|
|
|
Stack(
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
clipBehavior: Clip.none,
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
Text(recipientInformationData.nickname!, style: TextStyle(fontSize: 22.sp)),
|
|
|
|
|
|
Positioned(
|
|
|
|
|
|
left: (recipientInformationData.nickname!.length*19.w).w,
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
width: 80.w,
|
|
|
|
|
|
color: Colors.red,
|
2024-06-14 15:46:43 +08:00
|
|
|
|
child: Center(child: Text(state.type.value == 1 ? '个人用户' : '星寓', style: TextStyle(fontSize: 18.sp, color: Colors.white))),
|
2023-09-22 16:06:08 +08:00
|
|
|
|
),
|
|
|
|
|
|
)
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
|
Text(recipientInformationData.userid!, style: TextStyle(fontSize: 22.sp)),
|
|
|
|
|
|
SizedBox(height: 8.h),
|
2024-06-14 15:46:43 +08:00
|
|
|
|
Text('本次共转移${state.idList.value.length}把智能锁', style: TextStyle(fontSize: 20.sp)),
|
2023-09-22 16:06:08 +08:00
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
|
|
Row(
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
2024-06-14 15:46:43 +08:00
|
|
|
|
children: <Widget>[
|
2023-09-22 16:06:08 +08:00
|
|
|
|
ElevatedButton(
|
2024-05-30 09:27:29 +08:00
|
|
|
|
onPressed: Get.back,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
style: ElevatedButton.styleFrom(
|
2024-05-30 09:27:29 +08:00
|
|
|
|
foregroundColor: AppColors.appBarIconColor, backgroundColor: Colors.grey,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
minimumSize: Size(110.w, 45.h),
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
2024-04-17 15:03:11 +08:00
|
|
|
|
child: Text('取消'.tr, style: TextStyle(fontSize: 22.sp)),
|
2023-09-22 16:06:08 +08:00
|
|
|
|
),
|
|
|
|
|
|
ElevatedButton(
|
2024-05-30 09:27:29 +08:00
|
|
|
|
onPressed: Get.back,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
style: ElevatedButton.styleFrom(
|
2024-05-30 09:27:29 +08:00
|
|
|
|
foregroundColor: AppColors.appBarIconColor, backgroundColor: AppColors.mainColor,
|
2023-09-22 16:06:08 +08:00
|
|
|
|
minimumSize: Size(110.w, 45.h),
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(2)),
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
child: Text('确认', style: TextStyle(fontSize: 22.sp)),
|
|
|
|
|
|
),
|
|
|
|
|
|
],
|
|
|
|
|
|
)
|
|
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|