fix oct/8 issues

This commit is contained in:
ashrafzarkanisala
2024-10-08 20:15:52 +03:00
parent 66f6b1cba9
commit 79ec890244
19 changed files with 406 additions and 335 deletions
@@ -15,6 +15,9 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
List<AllDevicesModel> _selectedDevices = [];
List<AllDevicesModel> _filteredDevices = [];
String productName = '';
String? currentCommunity;
String? currentUnitName;
String? currentProductName;
DeviceManagementBloc() : super(DeviceManagementInitial()) {
on<FetchDevices>(_onFetchDevices);
@@ -234,6 +237,16 @@ class DeviceManagementBloc extends Bloc<DeviceManagementEvent, DeviceManagementS
}
void _onSearchDevices(SearchDevices event, Emitter<DeviceManagementState> emit) {
if (event.productName == currentProductName &&
event.community == currentCommunity &&
event.unitName == currentUnitName) {
return;
}
currentProductName = event.productName;
currentCommunity = event.community;
currentUnitName = event.unitName;
if ((event.community == null || event.community!.isEmpty) &&
(event.unitName == null || event.unitName!.isEmpty) &&
(event.productName == null || event.productName!.isEmpty)) {