diff --git a/lib/pages/device_managment/all_devices/bloc/device_managment_bloc.dart b/lib/pages/device_managment/all_devices/bloc/device_managment_bloc.dart index 628e2d5f..8f6d085d 100644 --- a/lib/pages/device_managment/all_devices/bloc/device_managment_bloc.dart +++ b/lib/pages/device_managment/all_devices/bloc/device_managment_bloc.dart @@ -286,10 +286,11 @@ class DeviceManagementBloc false); final matchesUnit = event.unitName == null || event.unitName!.isEmpty || - (device.unit?.name - ?.toLowerCase() - .contains(event.unitName!.toLowerCase()) ?? - false); + (device.spaces != null && + device.spaces!.isNotEmpty && + device.spaces![0].spaceName + !.toLowerCase() + .contains(event.unitName!.toLowerCase())); final matchesProductName = event.productName == null || event.productName!.isEmpty || (device.name