address book search fixes

This commit is contained in:
julian 2022-11-17 09:04:54 -06:00
parent 49103c86f1
commit 8c0a6f5669
2 changed files with 26 additions and 26 deletions

View file

@ -261,6 +261,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
onTap: () async {
setState(() {
_searchController.text = "";
_searchTerm = "";
});
},
),

View file

@ -152,12 +152,6 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
ref.read(addressBookServiceProvider).matches(_searchTerm, e))
.where((element) => element.isFavorite);
print("=========================================================");
print("contacts: ${contacts.length}");
print("favorites: ${favorites.length}");
print("allContacts: ${allContacts.length}");
print("=========================================================");
return DesktopScaffold(
appBar: DesktopAppBar(
isCompactHeight: true,
@ -222,6 +216,7 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
onTap: () async {
setState(() {
_searchController.text = "";
_searchTerm = "";
});
},
),
@ -284,8 +279,18 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
style: STextStyles.smallMed12(context),
),
),
favorites: favorites.isNotEmpty
? RoundedWhiteContainer(
favorites: favorites.isEmpty
? contacts.isNotEmpty
? null
: RoundedWhiteContainer(
child: Center(
child: Text(
"Your favorite contacts will appear here",
style: STextStyles.itemSubtitle(context),
),
),
)
: RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: Column(
children: [
@ -297,17 +302,19 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
),
],
),
)
),
all: allContacts.isEmpty
? contacts.isNotEmpty
? null
: RoundedWhiteContainer(
child: Center(
child: Text(
"Your favorite contacts will appear here",
"Your contacts will appear here",
style: STextStyles.itemSubtitle(context),
),
),
),
all: allContacts.isNotEmpty
? Column(
)
: Column(
children: [
RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
@ -326,14 +333,6 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
),
),
],
)
: RoundedWhiteContainer(
child: Center(
child: Text(
"Your contacts will appear here",
style: STextStyles.itemSubtitle(context),
),
),
),
details: Container(
color: Colors.purple,