feat:修复锁详情 ui报错

This commit is contained in:
anfe 2024-06-18 14:12:08 +08:00
parent f9cffeb49f
commit 17231d7ad7
2 changed files with 15 additions and 14 deletions

View File

@ -102,7 +102,7 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Column(
children: <Widget>[
SizedBox(
height: 15.h,
height: 10.h,
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w),
@ -113,20 +113,16 @@ class _LockDetailPageState extends State<LockDetailPage>
),
),
SizedBox(
height: 35.h,
height: 20.h,
),
xhjInfoView(),
SizedBox(
height: 35.h,
height: 20.h,
),
labelText(
img: 'images/icon_slider_horizontal.png',
text: '功能'.tr,
child: bottomWidget()),
labelText(
img: 'images/icon_puzzlepiece_extension.png',
text: '配件'.tr,
child: attachmentWidget()),
btnText(
img: 'images/main/icon_main_set.png',
text: TranslationLoader.lanKeys!.set!.tr,
@ -140,6 +136,10 @@ class _LockDetailPageState extends State<LockDetailPage>
'isOnlyOneData': state.isOnlyOneData
});
}),
labelText(
img: 'images/icon_puzzlepiece_extension.png',
text: '配件'.tr,
child: attachmentWidget()),
],
),
),
@ -207,7 +207,7 @@ class _LockDetailPageState extends State<LockDetailPage>
{required String img, required String text, required Widget child}) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 20.h),
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.r),
@ -899,7 +899,7 @@ class _LockDetailPageState extends State<LockDetailPage>
child: GridView.count(
crossAxisCount: 4,
// childAspectRatio: 3,
crossAxisSpacing: 20.w,
crossAxisSpacing: 0.w,
mainAxisSpacing: 0.h,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
@ -945,8 +945,8 @@ class _LockDetailPageState extends State<LockDetailPage>
child: GridView.count(
crossAxisCount: 4,
// childAspectRatio: 3,
crossAxisSpacing: 25.h,
mainAxisSpacing: 5.h,
crossAxisSpacing: 0.h,
mainAxisSpacing: 0.h,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: getBottomWidget()),

View File

@ -42,9 +42,10 @@ class LockMainLogic extends BaseGetXController {
}
void loadMainDataLogic(LockListInfoGroupEntity entity) {
final bool every = entity.groupList!.every((GroupList list) =>
(list.lockList ?? <LockListInfoItemEntity>[]).isEmpty);
if (entity.groupList!.isEmpty || every) {
final bool every = entity.groupList?.every((GroupList list) =>
(list.lockList ?? <LockListInfoItemEntity>[]).isEmpty) ??
false;
if ((entity.groupList??<GroupList>[]).isEmpty || every) {
state.dataLength.value = 0;
} else if (entity.groupList!.length == 1) {
final GroupList groupList = entity.groupList![0];