diff --git a/lib/pages/space_management_v2/modules/space_details/presentation/widgets/space_details_devices_box.dart b/lib/pages/space_management_v2/modules/space_details/presentation/widgets/space_details_devices_box.dart index 6def57d9..bfd68b9e 100644 --- a/lib/pages/space_management_v2/modules/space_details/presentation/widgets/space_details_devices_box.dart +++ b/lib/pages/space_management_v2/modules/space_details/presentation/widgets/space_details_devices_box.dart @@ -6,14 +6,20 @@ import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/constants/assets.dart'; class SpaceDetailsDevicesBox extends StatelessWidget { - const SpaceDetailsDevicesBox({super.key, required this.space}); + const SpaceDetailsDevicesBox({ + required this.space, + super.key, + }); final SpaceDetailsModel space; @override Widget build(BuildContext context) { - if (space.productAllocations.isNotEmpty || - space.subspaces.any((subspace) => subspace.productAllocations.isNotEmpty)) { + final productAllocations = space.productAllocations; + final subspaces = space.subspaces; + final isAnySubspaceHasProductAllocations = + subspaces.any((subspace) => subspace.productAllocations.isNotEmpty); + if (productAllocations.isNotEmpty || isAnySubspaceHasProductAllocations) { return Container( width: double.infinity, padding: const EdgeInsets.all(8.0),