Refactor code structure for improved readability and maintainability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -14,8 +14,17 @@ class InventoryQuery {
|
||||
const InventoryQuery({required this.location, required this.sort});
|
||||
}
|
||||
|
||||
final inventoryLocationFilterProvider = StateProvider<String>((ref) => '');
|
||||
final inventorySortFilterProvider = StateProvider<String>((ref) => '');
|
||||
class _StringNotifier extends Notifier<String> {
|
||||
_StringNotifier(this._initial);
|
||||
final String _initial;
|
||||
@override
|
||||
String build() => _initial;
|
||||
}
|
||||
|
||||
final inventoryLocationFilterProvider =
|
||||
NotifierProvider<_StringNotifier, String>(() => _StringNotifier(''));
|
||||
final inventorySortFilterProvider =
|
||||
NotifierProvider<_StringNotifier, String>(() => _StringNotifier(''));
|
||||
|
||||
final inventoryQueryProvider = Provider<InventoryQuery>((ref) {
|
||||
final location = ref.watch(inventoryLocationFilterProvider);
|
||||
|
||||
Reference in New Issue
Block a user