mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Refactor AccessBloc to emit filtered data instead of fetching; clean up device search filters for improved readability.
This commit is contained in:
@ -267,7 +267,8 @@ class AccessBloc extends Bloc<AccessEvent, AccessState> {
|
|||||||
selectedIndex = 0;
|
selectedIndex = 0;
|
||||||
effectiveTimeTimeStamp = null;
|
effectiveTimeTimeStamp = null;
|
||||||
expirationTimeTimeStamp = null;
|
expirationTimeTimeStamp = null;
|
||||||
add(FetchTableData());
|
filteredData = List.from(data);
|
||||||
|
emit(TableLoaded(filteredData));
|
||||||
}
|
}
|
||||||
|
|
||||||
String timestampToDate(dynamic timestamp) {
|
String timestampToDate(dynamic timestamp) {
|
||||||
|
@ -34,7 +34,8 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters>
|
|||||||
runSpacing: 10,
|
runSpacing: 10,
|
||||||
children: [
|
children: [
|
||||||
_buildSearchField("Space Name", _unitNameController, 200),
|
_buildSearchField("Space Name", _unitNameController, 200),
|
||||||
_buildSearchField("Device Name / Product Name", _productNameController, 300),
|
_buildSearchField(
|
||||||
|
"Device Name / Product Name", _productNameController, 300),
|
||||||
_buildSearchResetButtons(),
|
_buildSearchResetButtons(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -74,9 +75,7 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters>
|
|||||||
onReset: () {
|
onReset: () {
|
||||||
_unitNameController.clear();
|
_unitNameController.clear();
|
||||||
_productNameController.clear();
|
_productNameController.clear();
|
||||||
context.read<DeviceManagementBloc>()
|
context.read<DeviceManagementBloc>().add(ResetFilters());
|
||||||
..add(ResetFilters())
|
|
||||||
..add(FetchDevices(context));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user