Search/filter refactor
This commit is contained in:
parent
eb39ed55b5
commit
9615f72964
|
|
@ -243,50 +243,50 @@ abstract class ClientEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
search = search.toLowerCase();
|
||||
if (displayName.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (displayName.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (vatNumber.toLowerCase().contains(search)) {
|
||||
if (vatNumber.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (idNumber.toLowerCase().contains(search)) {
|
||||
if (idNumber.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (workPhone.toLowerCase().contains(search)) {
|
||||
if (workPhone.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (contacts.where((contact) => contact.matchesSearch(search)).isNotEmpty) {
|
||||
if (contacts.where((contact) => contact.matchesFilter(filter)).isNotEmpty) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
if (vatNumber.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (vatNumber.toLowerCase().contains(filter)) {
|
||||
return vatNumber;
|
||||
}
|
||||
if (idNumber.toLowerCase().contains(search)) {
|
||||
if (idNumber.toLowerCase().contains(filter)) {
|
||||
return idNumber;
|
||||
}
|
||||
if (workPhone.toLowerCase().contains(search)) {
|
||||
if (workPhone.toLowerCase().contains(filter)) {
|
||||
return workPhone;
|
||||
}
|
||||
final contact = contacts.firstWhere(
|
||||
(contact) => contact.matchesSearch(search),
|
||||
(contact) => contact.matchesFilter(filter),
|
||||
orElse: () => null);
|
||||
if (contact != null) {
|
||||
return contact.matchesSearchValue(search);
|
||||
return contact.matchesFilterValue(filter);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
@ -375,38 +375,38 @@ abstract class ContactEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
search = search.toLowerCase();
|
||||
if (firstName.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (firstName.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (lastName.toLowerCase().contains(search)) {
|
||||
if (lastName.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (phone.toLowerCase().contains(search)) {
|
||||
if (phone.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
if (email.toLowerCase().contains(search)) {
|
||||
if (email.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
if (fullName.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (fullName.toLowerCase().contains(filter)) {
|
||||
return fullName;
|
||||
} else if (email.toLowerCase().contains(search)) {
|
||||
} else if (email.toLowerCase().contains(filter)) {
|
||||
return email;
|
||||
} else if (phone.toLowerCase().contains(search)) {
|
||||
} else if (phone.toLowerCase().contains(filter)) {
|
||||
return phone;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,17 +100,17 @@ abstract class CreditEntity extends Object with BaseEntity implements Built<Cred
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return publicNotes.contains(search);
|
||||
return publicNotes.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ abstract class SelectableEntity {
|
|||
@nullable
|
||||
int get id;
|
||||
|
||||
bool matchesSearch(String search) => true;
|
||||
String matchesSearchValue(String search) => null;
|
||||
bool matchesFilter(String filter) => true;
|
||||
String matchesFilterValue(String filter) => null;
|
||||
|
||||
String get listDisplayName => 'Error: listDisplayName not set';
|
||||
|
||||
|
|
|
|||
|
|
@ -176,17 +176,17 @@ abstract class ExpenseEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return privateNotes.contains(search);
|
||||
return privateNotes.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -216,8 +216,8 @@ abstract class ExpenseCategoryEntity extends Object
|
|||
ExpenseCategoryEntity._();
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -225,8 +225,8 @@ abstract class ExpenseCategoryEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -293,18 +293,18 @@ abstract class InvoiceEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (invoiceNumber.toLowerCase().contains(search)) {
|
||||
if (invoiceNumber.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (customTextValue1.isNotEmpty &&
|
||||
customTextValue1.toLowerCase().contains(search)) {
|
||||
customTextValue1.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (customTextValue2.isNotEmpty &&
|
||||
customTextValue2.toLowerCase().contains(search)) {
|
||||
customTextValue2.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -312,19 +312,19 @@ abstract class InvoiceEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
if (invoiceNumber.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (invoiceNumber.toLowerCase().contains(filter)) {
|
||||
return invoiceNumber;
|
||||
} else if (customTextValue1.isNotEmpty &&
|
||||
customTextValue1.toLowerCase().contains(search)) {
|
||||
customTextValue1.toLowerCase().contains(filter)) {
|
||||
return customTextValue1;
|
||||
} else if (customTextValue2.isNotEmpty &&
|
||||
customTextValue2.toLowerCase().contains(search)) {
|
||||
customTextValue2.toLowerCase().contains(filter)) {
|
||||
return customTextValue2;
|
||||
}
|
||||
return null;
|
||||
|
|
@ -427,8 +427,8 @@ abstract class InvoiceItemEntity extends Object
|
|||
double get total => qty * cost;
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -436,8 +436,8 @@ abstract class InvoiceItemEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -491,8 +491,8 @@ abstract class InvitationEntity extends Object
|
|||
String get downloadLink => link.replaceFirst('/view/', '/download/');
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -500,8 +500,8 @@ abstract class InvitationEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,17 +111,17 @@ abstract class PaymentEntity extends Object with BaseEntity implements Built<Pay
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return privateNotes.contains(search);
|
||||
return privateNotes.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -146,22 +146,22 @@ abstract class ProductEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (productKey.toLowerCase().contains(search)) {
|
||||
if (productKey.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (notes.toLowerCase().contains(search)) {
|
||||
} else if (notes.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (customValue1.isNotEmpty &&
|
||||
customValue1.toLowerCase().contains(search)) {
|
||||
customValue1.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (customValue2.isNotEmpty &&
|
||||
customValue2.toLowerCase().contains(search)) {
|
||||
customValue2.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -169,19 +169,19 @@ abstract class ProductEntity extends Object
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
if (notes.toLowerCase().contains(search)) {
|
||||
filter = filter.toLowerCase();
|
||||
if (notes.toLowerCase().contains(filter)) {
|
||||
return notes;
|
||||
} else if (customValue1.isNotEmpty &&
|
||||
customValue1.toLowerCase().contains(search)) {
|
||||
customValue1.toLowerCase().contains(filter)) {
|
||||
return customValue1;
|
||||
} else if (customValue2.isNotEmpty &&
|
||||
customValue2.toLowerCase().contains(search)) {
|
||||
customValue2.toLowerCase().contains(filter)) {
|
||||
return customValue2;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -109,17 +109,17 @@ abstract class ProjectEntity extends Object with BaseEntity implements Built<Pro
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return name.contains(search);
|
||||
return name.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,18 +141,18 @@ abstract class CountryEntity extends Object with SelectableEntity implements Bui
|
|||
*/
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (name.toLowerCase().contains(search)) {
|
||||
if (name.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (iso2.toLowerCase().contains(search)) {
|
||||
} else if (iso2.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (iso3.toLowerCase().contains(search)) {
|
||||
} else if (iso3.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -160,16 +160,16 @@ abstract class CountryEntity extends Object with SelectableEntity implements Bui
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (iso2.toLowerCase().contains(search)) {
|
||||
if (iso2.toLowerCase().contains(filter)) {
|
||||
return iso2;
|
||||
} else if (iso3.toLowerCase().contains(search)) {
|
||||
} else if (iso3.toLowerCase().contains(filter)) {
|
||||
return iso3;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,16 +76,16 @@ abstract class CurrencyEntity extends Object with SelectableEntity implements Bu
|
|||
double get exchangeRate;
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (name.toLowerCase().contains(search)) {
|
||||
if (name.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (code.toLowerCase().contains(search)) {
|
||||
} else if (code.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -93,14 +93,14 @@ abstract class CurrencyEntity extends Object with SelectableEntity implements Bu
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (code.toLowerCase().contains(search)) {
|
||||
if (code.toLowerCase().contains(filter)) {
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,16 +46,16 @@ abstract class LanguageEntity extends Object with SelectableEntity implements Bu
|
|||
String get locale;
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (name.toLowerCase().contains(search)) {
|
||||
if (name.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
} else if (locale.toLowerCase().contains(search)) {
|
||||
} else if (locale.toLowerCase().contains(filter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -63,14 +63,14 @@ abstract class LanguageEntity extends Object with SelectableEntity implements Bu
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
search = search.toLowerCase();
|
||||
filter = filter.toLowerCase();
|
||||
|
||||
if (locale.toLowerCase().contains(search)) {
|
||||
if (locale.toLowerCase().contains(filter)) {
|
||||
return locale;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,17 +114,17 @@ abstract class TaskEntity extends Object with BaseEntity implements Built<TaskEn
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return description.contains(search);
|
||||
return description.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,17 +155,17 @@ abstract class VendorEntity extends Object with BaseEntity implements Built<Vend
|
|||
}
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return name.contains(search);
|
||||
return name.contains(filter);
|
||||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -219,8 +219,8 @@ abstract class VendorContactEntity extends Object with BaseEntity implements Bui
|
|||
String get phone;
|
||||
|
||||
@override
|
||||
bool matchesSearch(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
bool matchesFilter(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -228,8 +228,8 @@ abstract class VendorContactEntity extends Object with BaseEntity implements Bui
|
|||
}
|
||||
|
||||
@override
|
||||
String matchesSearchValue(String search) {
|
||||
if (search == null || search.isEmpty) {
|
||||
String matchesFilterValue(String filter) {
|
||||
if (filter == null || filter.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -185,9 +185,9 @@ class RestoreClientFailure implements StopSaving {
|
|||
|
||||
|
||||
|
||||
class SearchClients {
|
||||
final String search;
|
||||
SearchClients(this.search);
|
||||
class FilterClients {
|
||||
final String filter;
|
||||
FilterClients(this.filter);
|
||||
}
|
||||
|
||||
class SortClients implements PersistUI {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ ClientEntity _updateContact(ClientEntity client, UpdateContact action) {
|
|||
final clientListReducer = combineReducers<ListUIState>([
|
||||
TypedReducer<ListUIState, SortClients>(_sortClients),
|
||||
TypedReducer<ListUIState, FilterClientsByState>(_filterClientsByState),
|
||||
TypedReducer<ListUIState, SearchClients>(_searchClients),
|
||||
TypedReducer<ListUIState, FilterClients>(_filterClients),
|
||||
]);
|
||||
|
||||
ListUIState _filterClientsByState(ListUIState clientListState, FilterClientsByState action) {
|
||||
|
|
@ -87,9 +87,9 @@ ListUIState _filterClientsByState(ListUIState clientListState, FilterClientsBySt
|
|||
}
|
||||
}
|
||||
|
||||
ListUIState _searchClients(ListUIState clientListState, SearchClients action) {
|
||||
ListUIState _filterClients(ListUIState clientListState, FilterClients action) {
|
||||
return clientListState.rebuild((b) => b
|
||||
..search = action.search
|
||||
..filter = action.filter
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ List<int> filteredClientsSelector(BuiltMap<int, ClientEntity> clientMap,
|
|||
if (!client.matchesStates(clientListState.stateFilters)) {
|
||||
return false;
|
||||
}
|
||||
return client.matchesSearch(clientListState.search);
|
||||
return client.matchesFilter(clientListState.filter);
|
||||
}).toList();
|
||||
|
||||
list.sort((clientAId, clientBId) {
|
||||
|
|
|
|||
|
|
@ -219,10 +219,9 @@ class RestoreInvoiceFailure implements StopSaving {
|
|||
|
||||
|
||||
|
||||
|
||||
class SearchInvoices {
|
||||
final String search;
|
||||
SearchInvoices(this.search);
|
||||
class FilterInvoices {
|
||||
final String filter;
|
||||
FilterInvoices(this.filter);
|
||||
}
|
||||
|
||||
class SortInvoices implements PersistUI {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ final invoiceListReducer = combineReducers<ListUIState>([
|
|||
TypedReducer<ListUIState, FilterInvoicesByState>(_filterInvoicesByState),
|
||||
TypedReducer<ListUIState, FilterInvoicesByStatus>(_filterInvoicesByStatus),
|
||||
TypedReducer<ListUIState, FilterInvoicesByClient>(_filterInvoicesByClient),
|
||||
TypedReducer<ListUIState, SearchInvoices>(_searchInvoices),
|
||||
TypedReducer<ListUIState, FilterInvoices>(_filterInvoices),
|
||||
]);
|
||||
|
||||
ListUIState _filterInvoicesByState(ListUIState invoiceListState, FilterInvoicesByState action) {
|
||||
|
|
@ -123,9 +123,9 @@ ListUIState _filterInvoicesByClient(ListUIState invoiceListState, FilterInvoices
|
|||
);
|
||||
}
|
||||
|
||||
ListUIState _searchInvoices(ListUIState invoiceListState, SearchInvoices action) {
|
||||
ListUIState _filterInvoices(ListUIState invoiceListState, FilterInvoices action) {
|
||||
return invoiceListState.rebuild((b) => b
|
||||
..search = action.search
|
||||
..filter = action.filter
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ List<int> filteredInvoicesSelector(
|
|||
if (!invoice.matchesStatuses(invoiceListState.statusFilters)) {
|
||||
return false;
|
||||
}
|
||||
if (!invoice.matchesSearch(invoiceListState.search)) {
|
||||
if (!invoice.matchesFilter(invoiceListState.filter)) {
|
||||
return false;
|
||||
}
|
||||
if (invoiceListState.filterClientId != null &&
|
||||
|
|
|
|||
|
|
@ -123,9 +123,9 @@ class RestoreProductFailure implements StopSaving {
|
|||
}
|
||||
|
||||
|
||||
class SearchProducts {
|
||||
final String search;
|
||||
SearchProducts(this.search);
|
||||
class FilterProducts {
|
||||
final String filter;
|
||||
FilterProducts(this.filter);
|
||||
}
|
||||
|
||||
class SortProducts implements PersistUI {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ ProductEntity _updateEditing(ProductEntity client, dynamic action) {
|
|||
final productListReducer = combineReducers<ListUIState>([
|
||||
TypedReducer<ListUIState, SortProducts>(_sortProducts),
|
||||
TypedReducer<ListUIState, FilterProductsByState>(_filterProductsByState),
|
||||
TypedReducer<ListUIState, SearchProducts>(_searchProducts),
|
||||
TypedReducer<ListUIState, FilterProducts>(_filterProducts),
|
||||
]);
|
||||
|
||||
ListUIState _filterProductsByState(ListUIState productListState, FilterProductsByState action) {
|
||||
|
|
@ -58,9 +58,9 @@ ListUIState _filterProductsByState(ListUIState productListState, FilterProductsB
|
|||
}
|
||||
}
|
||||
|
||||
ListUIState _searchProducts(ListUIState productListState, SearchProducts action) {
|
||||
ListUIState _filterProducts(ListUIState productListState, FilterProducts action) {
|
||||
return productListState.rebuild((b) => b
|
||||
..search = action.search
|
||||
..filter = action.filter
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ List<int> filteredProductsSelector(
|
|||
if (! product.matchesStates(productListState.stateFilters)) {
|
||||
return false;
|
||||
}
|
||||
if (! product.matchesSearch(productListState.search)) {
|
||||
if (! product.matchesFilter(productListState.filter)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ abstract class ListUIState implements Built<ListUIState, ListUIStateBuilder> {
|
|||
ListUIState._();
|
||||
|
||||
@nullable
|
||||
String get search;
|
||||
String get filter;
|
||||
|
||||
@nullable
|
||||
int get filterClientId;
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ class _$ListUIStateSerializer implements StructuredSerializer<ListUIState> {
|
|||
specifiedType:
|
||||
const FullType(BuiltList, const [const FullType(EntityStatus)])),
|
||||
];
|
||||
if (object.search != null) {
|
||||
if (object.filter != null) {
|
||||
result
|
||||
..add('search')
|
||||
..add(serializers.serialize(object.search,
|
||||
..add('filter')
|
||||
..add(serializers.serialize(object.filter,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.filterClientId != null) {
|
||||
|
|
@ -68,8 +68,8 @@ class _$ListUIStateSerializer implements StructuredSerializer<ListUIState> {
|
|||
iterator.moveNext();
|
||||
final dynamic value = iterator.current;
|
||||
switch (key) {
|
||||
case 'search':
|
||||
result.search = serializers.deserialize(value,
|
||||
case 'filter':
|
||||
result.filter = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case 'filterClientId':
|
||||
|
|
@ -105,7 +105,7 @@ class _$ListUIStateSerializer implements StructuredSerializer<ListUIState> {
|
|||
|
||||
class _$ListUIState extends ListUIState {
|
||||
@override
|
||||
final String search;
|
||||
final String filter;
|
||||
@override
|
||||
final int filterClientId;
|
||||
@override
|
||||
|
|
@ -121,7 +121,7 @@ class _$ListUIState extends ListUIState {
|
|||
(new ListUIStateBuilder()..update(updates)).build();
|
||||
|
||||
_$ListUIState._(
|
||||
{this.search,
|
||||
{this.filter,
|
||||
this.filterClientId,
|
||||
this.sortField,
|
||||
this.sortAscending,
|
||||
|
|
@ -149,7 +149,7 @@ class _$ListUIState extends ListUIState {
|
|||
bool operator ==(dynamic other) {
|
||||
if (identical(other, this)) return true;
|
||||
if (other is! ListUIState) return false;
|
||||
return search == other.search &&
|
||||
return filter == other.filter &&
|
||||
filterClientId == other.filterClientId &&
|
||||
sortField == other.sortField &&
|
||||
sortAscending == other.sortAscending &&
|
||||
|
|
@ -162,7 +162,7 @@ class _$ListUIState extends ListUIState {
|
|||
return $jf($jc(
|
||||
$jc(
|
||||
$jc(
|
||||
$jc($jc($jc(0, search.hashCode), filterClientId.hashCode),
|
||||
$jc($jc($jc(0, filter.hashCode), filterClientId.hashCode),
|
||||
sortField.hashCode),
|
||||
sortAscending.hashCode),
|
||||
stateFilters.hashCode),
|
||||
|
|
@ -172,7 +172,7 @@ class _$ListUIState extends ListUIState {
|
|||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper('ListUIState')
|
||||
..add('search', search)
|
||||
..add('filter', filter)
|
||||
..add('filterClientId', filterClientId)
|
||||
..add('sortField', sortField)
|
||||
..add('sortAscending', sortAscending)
|
||||
|
|
@ -185,9 +185,9 @@ class _$ListUIState extends ListUIState {
|
|||
class ListUIStateBuilder implements Builder<ListUIState, ListUIStateBuilder> {
|
||||
_$ListUIState _$v;
|
||||
|
||||
String _search;
|
||||
String get search => _$this._search;
|
||||
set search(String search) => _$this._search = search;
|
||||
String _filter;
|
||||
String get filter => _$this._filter;
|
||||
set filter(String filter) => _$this._filter = filter;
|
||||
|
||||
int _filterClientId;
|
||||
int get filterClientId => _$this._filterClientId;
|
||||
|
|
@ -219,7 +219,7 @@ class ListUIStateBuilder implements Builder<ListUIState, ListUIStateBuilder> {
|
|||
|
||||
ListUIStateBuilder get _$this {
|
||||
if (_$v != null) {
|
||||
_search = _$v.search;
|
||||
_filter = _$v.filter;
|
||||
_filterClientId = _$v.filterClientId;
|
||||
_sortField = _$v.sortField;
|
||||
_sortAscending = _$v.sortAscending;
|
||||
|
|
@ -247,7 +247,7 @@ class ListUIStateBuilder implements Builder<ListUIState, ListUIStateBuilder> {
|
|||
try {
|
||||
_$result = _$v ??
|
||||
new _$ListUIState._(
|
||||
search: search,
|
||||
filter: filter,
|
||||
filterClientId: filterClientId,
|
||||
sortField: sortField,
|
||||
sortAscending: sortAscending,
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class _EntityDropdownDialogState extends State<EntityDropdownDialog> {
|
|||
Widget _createList() {
|
||||
final matches = widget.entityList
|
||||
.where(
|
||||
(entityId) => widget.entityMap[entityId].matchesSearch(_filter))
|
||||
(entityId) => widget.entityMap[entityId].matchesFilter(_filter))
|
||||
.toList();
|
||||
|
||||
return ListView.builder(
|
||||
|
|
@ -164,7 +164,7 @@ class _EntityDropdownDialogState extends State<EntityDropdownDialog> {
|
|||
itemBuilder: (BuildContext context, int index) {
|
||||
final int entityId = matches[index];
|
||||
final entity = widget.entityMap[entityId];
|
||||
final String subtitle = entity.matchesSearchValue(_filter);
|
||||
final String subtitle = entity.matchesFilterValue(_filter);
|
||||
return ListTile(
|
||||
dense: true,
|
||||
title: Row(
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
class AppSearch extends StatelessWidget {
|
||||
class ListFilter extends StatelessWidget {
|
||||
final EntityType entityType;
|
||||
final String search;
|
||||
final Function(String) onSearchChanged;
|
||||
final String filter;
|
||||
final Function(String) onFilterChanged;
|
||||
|
||||
const AppSearch({
|
||||
const ListFilter({
|
||||
this.entityType,
|
||||
this.search,
|
||||
this.onSearchChanged,
|
||||
this.filter,
|
||||
this.onFilterChanged,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -25,15 +25,15 @@ class AppSearch extends StatelessWidget {
|
|||
builder: (BuildContext context, state) {
|
||||
final listUIState = state.getListState(entityType);
|
||||
final bool enableDarkMode = state.uiState.enableDarkMode;
|
||||
return listUIState.search == null
|
||||
return listUIState.filter == null
|
||||
? Text(localization.lookup(entityType.plural.toString()))
|
||||
: Container(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
height: 38.0,
|
||||
margin: EdgeInsets.only(bottom: 2.0),
|
||||
decoration: BoxDecoration(
|
||||
color: listUIState.search != null &&
|
||||
listUIState.search.isNotEmpty
|
||||
color: listUIState.filter != null &&
|
||||
listUIState.filter.isNotEmpty
|
||||
? enableDarkMode
|
||||
? Colors.yellow.shade900
|
||||
: Colors.yellow.shade200
|
||||
|
|
@ -51,10 +51,10 @@ class AppSearch extends StatelessWidget {
|
|||
child: Icon(Icons.search),
|
||||
),
|
||||
border: InputBorder.none,
|
||||
hintText: localization.search),
|
||||
hintText: localization.filter),
|
||||
autofocus: true,
|
||||
autocorrect: false,
|
||||
onChanged: (value) => onSearchChanged(value),
|
||||
onChanged: (value) => onFilterChanged(value),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
@ -6,14 +6,14 @@ import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
|
|||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
||||
class AppSearchButton extends StatelessWidget {
|
||||
class ListFilterButton extends StatelessWidget {
|
||||
|
||||
final EntityType entityType;
|
||||
final Function onSearchPressed;
|
||||
final Function onFilterPressed;
|
||||
|
||||
const AppSearchButton({
|
||||
const ListFilterButton({
|
||||
this.entityType,
|
||||
this.onSearchPressed,
|
||||
this.onFilterPressed,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -26,9 +26,9 @@ class AppSearchButton extends StatelessWidget {
|
|||
distinct: true,
|
||||
builder: (BuildContext context, listUIState) {
|
||||
return IconButton(
|
||||
icon: Icon(listUIState.search == null ? Icons.search : Icons.close),
|
||||
tooltip: localization.search,
|
||||
onPressed: () => onSearchPressed(listUIState.search == null ? '' : null),
|
||||
icon: Icon(listUIState.filter == null ? Icons.search : Icons.close),
|
||||
tooltip: localization.filter,
|
||||
onPressed: () => onFilterPressed(listUIState.filter == null ? '' : null),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
@ -25,8 +25,8 @@ class ClientListItem extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//var localization = AppLocalization.of(context);
|
||||
final searchMatch = filter != null && filter.isNotEmpty
|
||||
? client.matchesSearchValue(filter)
|
||||
final filterMatch = filter != null && filter.isNotEmpty
|
||||
? client.matchesFilterValue(filter)
|
||||
: null;
|
||||
|
||||
return DismissibleEntity(
|
||||
|
|
@ -50,10 +50,10 @@ class ClientListItem extends StatelessWidget {
|
|||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
searchMatch == null
|
||||
filterMatch == null
|
||||
? Container()
|
||||
: Text(
|
||||
searchMatch,
|
||||
filterMatch,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class ClientListVM {
|
|||
clientMap: store.state.clientState.map,
|
||||
isLoading: store.state.isLoading,
|
||||
isLoaded: store.state.clientState.isLoaded,
|
||||
filter: store.state.clientListState.search,
|
||||
filter: store.state.clientListState.filter,
|
||||
onClientTap: (context, client) {
|
||||
store.dispatch(ViewClient(clientId: client.id, context: context));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:invoiceninja_flutter/ui/app/app_search.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_search_button.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -20,17 +20,17 @@ class ClientScreen extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: AppSearch(
|
||||
title: ListFilter(
|
||||
entityType: EntityType.client,
|
||||
onSearchChanged: (value) {
|
||||
store.dispatch(SearchClients(value));
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterClients(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
AppSearchButton(
|
||||
ListFilterButton(
|
||||
entityType: EntityType.client,
|
||||
onSearchPressed: (String value) {
|
||||
store.dispatch(SearchClients(value));
|
||||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterClients(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector> {
|
|||
Widget _entityList() {
|
||||
final matches = memoizedProductList(widget.productMap).where((entityId) {
|
||||
final entity = widget.productMap[entityId];
|
||||
return entity.isActive && entity.matchesSearch(_filter);
|
||||
return entity.isActive && entity.matchesFilter(_filter);
|
||||
}).toList();
|
||||
|
||||
matches.sort((idA, idB) =>
|
||||
|
|
@ -150,7 +150,7 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector> {
|
|||
itemBuilder: (BuildContext context, int index) {
|
||||
final int entityId = matches[index];
|
||||
final entity = widget.productMap[entityId];
|
||||
final String subtitle = entity.matchesSearchValue(_filter);
|
||||
final String subtitle = entity.matchesFilterValue(_filter);
|
||||
return ListTile(
|
||||
dense: true,
|
||||
leading: Checkbox(
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class InvoiceListItem extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localization = AppLocalization.of(context);
|
||||
final searchMatch = filter != null && filter.isNotEmpty
|
||||
? invoice.matchesSearchValue(filter)
|
||||
final filterMatch = filter != null && filter.isNotEmpty
|
||||
? invoice.matchesFilterValue(filter)
|
||||
: null;
|
||||
|
||||
return DismissibleEntity(
|
||||
|
|
@ -58,10 +58,10 @@ class InvoiceListItem extends StatelessWidget {
|
|||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: searchMatch == null
|
||||
child: filterMatch == null
|
||||
? Text(invoice.invoiceNumber)
|
||||
: Text(
|
||||
searchMatch,
|
||||
filterMatch,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class InvoiceListVM {
|
|||
clientMap: state.clientState.map,
|
||||
isLoading: state.isLoading,
|
||||
isLoaded: state.invoiceState.isLoaded && state.clientState.isLoaded,
|
||||
filter: state.invoiceListState.search,
|
||||
filter: state.invoiceListState.filter,
|
||||
onInvoiceTap: (context, invoice) {
|
||||
store.dispatch(ViewInvoice(invoiceId: invoice.id, context: context));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:invoiceninja_flutter/ui/app/app_search.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_search_button.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -22,17 +22,17 @@ class InvoiceScreen extends StatelessWidget {
|
|||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
appBar: AppBar(
|
||||
title: AppSearch(
|
||||
title: ListFilter(
|
||||
entityType: EntityType.invoice,
|
||||
onSearchChanged: (value) {
|
||||
store.dispatch(SearchInvoices(value));
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterInvoices(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
AppSearchButton(
|
||||
ListFilterButton(
|
||||
entityType: EntityType.invoice,
|
||||
onSearchPressed: (String value) {
|
||||
store.dispatch(SearchInvoices(value));
|
||||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterInvoices(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -24,10 +24,10 @@ class ProductListItem extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final searchMatch = filter != null && filter.isNotEmpty
|
||||
? product.matchesSearchValue(filter)
|
||||
final filterMatch = filter != null && filter.isNotEmpty
|
||||
? product.matchesFilterValue(filter)
|
||||
: null;
|
||||
final subtitle = searchMatch ?? product.notes;
|
||||
final subtitle = filterMatch ?? product.notes;
|
||||
|
||||
return DismissibleEntity(
|
||||
entity: product,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class ProductListVM {
|
|||
productMap: store.state.productState.map,
|
||||
isLoading: store.state.isLoading,
|
||||
isLoaded: store.state.productState.isLoaded,
|
||||
filter: store.state.productUIState.listUIState.search,
|
||||
filter: store.state.productUIState.listUIState.filter,
|
||||
onProductTap: (context, product) {
|
||||
store.dispatch(EditProduct(product: product, context: context));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:invoiceninja_flutter/ui/app/app_search.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_search_button.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -21,17 +21,17 @@ class ProductScreen extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: AppSearch(
|
||||
title: ListFilter(
|
||||
entityType: EntityType.product,
|
||||
onSearchChanged: (value) {
|
||||
store.dispatch(SearchProducts(value));
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterProducts(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
AppSearchButton(
|
||||
ListFilterButton(
|
||||
entityType: EntityType.product,
|
||||
onSearchPressed: (String value) {
|
||||
store.dispatch(SearchProducts(value));
|
||||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterProducts(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue