110 lines
3.4 KiB
Dart
110 lines
3.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
|
import 'package:star_lock/tools/noData.dart';
|
|
import 'package:star_lock/tools/submitBtn.dart';
|
|
|
|
import '../../../../../app_settings/app_colors.dart';
|
|
import '../../../../../tools/titleAppBar.dart';
|
|
import '../../../../../translations/trans_lib.dart';
|
|
|
|
class GroupAddLockPage extends StatefulWidget {
|
|
const GroupAddLockPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<GroupAddLockPage> createState() => _GroupAddLockPageState();
|
|
}
|
|
|
|
class _GroupAddLockPageState extends State<GroupAddLockPage> {
|
|
List<LockListItem> lockList = [];
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
|
if (obj != null && (obj["lockList"] != null)) {
|
|
lockList = obj["lockList"];
|
|
}
|
|
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.lock!.tr,
|
|
haveBack: true,
|
|
actionsList: [
|
|
IconButton(
|
|
icon: Image.asset(
|
|
'images/icon_bar_more.png',
|
|
height: 30.h,
|
|
width: 10.w,
|
|
),
|
|
onPressed: () {
|
|
// 处理操作按钮的点击事件-添加锁分组
|
|
},
|
|
),
|
|
],
|
|
backgroundColor: AppColors.mainColor),
|
|
body: lockList.isNotEmpty
|
|
? ListView.separated(
|
|
itemBuilder: (context, index) {
|
|
LockListItem itemData = lockList[index];
|
|
return _listItemView(itemData);
|
|
},
|
|
itemCount: lockList.length,
|
|
separatorBuilder: (BuildContext context, int index) {
|
|
return Divider(
|
|
height: 1.h,
|
|
color: AppColors.greyLineColor,
|
|
);
|
|
},
|
|
)
|
|
: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Positioned(
|
|
bottom: 350.h,
|
|
left: (ScreenUtil().screenWidth - 200.w) / 2,
|
|
width: 200.w,
|
|
child: SubmitBtn(
|
|
btnName: '添加',
|
|
onClick: () {
|
|
//选择要添加到分组的锁
|
|
},
|
|
)),
|
|
const NoData(),
|
|
],
|
|
));
|
|
}
|
|
|
|
Widget _listItemView(LockListItem itemData) {
|
|
return GestureDetector(
|
|
child: Container(
|
|
color: Colors.white,
|
|
height: 80.h,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(
|
|
width: 20.w,
|
|
),
|
|
Image.asset(
|
|
'images/icon_lockGroup_item.png',
|
|
width: 36,
|
|
height: 36,
|
|
fit: BoxFit.fill,
|
|
),
|
|
SizedBox(
|
|
width: 10.w,
|
|
),
|
|
Text(
|
|
itemData.lockAlias ?? '',
|
|
style: TextStyle(fontSize: 24.sp),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
onTap: () {},
|
|
);
|
|
}
|
|
}
|