diff --git a/lib/data/models/client_model.dart b/lib/data/models/client_model.dart index 77915ae35..32dd70022 100644 --- a/lib/data/models/client_model.dart +++ b/lib/data/models/client_model.dart @@ -32,6 +32,7 @@ class ClientFields { static const String updatedAt = 'updatedAt'; static const String archivedAt = 'archivedAt'; static const String isDeleted = 'isDeleted'; + static const String contact = 'contact'; } @@ -237,10 +238,17 @@ abstract class ClientEntity extends Object with BaseEntity implements Built contact.matchesSearch(search)).first; + if (contact != null) { + return contact.matchesSearchField(search); + } + return null; } @@ -252,10 +260,17 @@ abstract class ClientEntity extends Object with BaseEntity implements Built contact.matchesSearch(search)).first; + if (contact != null) { + return contact.matchesSearchValue(search); + } + return null; } @@ -264,6 +279,13 @@ abstract class ClientEntity extends Object with BaseEntity implements Built { static int counter = 0; @@ -307,6 +329,59 @@ abstract class ContactEntity extends Object with BaseEntity implements Built get serializer => _$contactEntitySerializer; diff --git a/lib/ui/app/entity_dropdown.dart b/lib/ui/app/entity_dropdown.dart index 6fd9beb62..108be7f2a 100644 --- a/lib/ui/app/entity_dropdown.dart +++ b/lib/ui/app/entity_dropdown.dart @@ -97,9 +97,12 @@ class _EntityDropdownState extends State { var filter = store.state.uiState.entityDropdownFilter; var subtitle = null; - var matchField = entity.matchesSearchField(filter); + var matchField = + entity.matchesSearchField(filter); if (matchField != null) { - subtitle = matchField + ': ' + entity.matchesSearchValue(filter); + var field = localization.lookup(matchField); + var value = entity.matchesSearchValue(filter); + subtitle = '$field: $value'; } return ListTile( dense: true, diff --git a/lib/utils/localization.dart b/lib/utils/localization.dart index 39b7607bf..6e0e9de09 100644 --- a/lib/utils/localization.dart +++ b/lib/utils/localization.dart @@ -126,6 +126,7 @@ class AppLocalization { 'unit_cost': 'Unit Cost', 'quantity': 'Quantity', 'add_item': 'Add Item', + 'contact': 'Contact', 'payment': 'Payment', 'payments': 'Payments', @@ -243,6 +244,7 @@ class AppLocalization { String get unitCost => _localizedValues[locale.languageCode]['unit_cost']; String get quantity => _localizedValues[locale.languageCode]['quantity']; String get addItem => _localizedValues[locale.languageCode]['add_item']; + String get contact => _localizedValues[locale.languageCode]['contact']; String get payment => _localizedValues[locale.languageCode]['payment'];