From e8430652782ec7453707a90687a56bb3fff74d9c Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 16 May 2023 09:33:28 -0600 Subject: [PATCH] fix: contact id access fixes --- .../subviews/contact_details_view.dart | 6 +++--- .../subviews/contact_popup.dart | 16 ++++++++-------- .../subwidgets/desktop_contact_details.dart | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index b25120584..b7d54ea71 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -270,7 +270,7 @@ class _ContactDetailsViewState extends ConsumerState { onPressed: () { Navigator.of(context).pushNamed( EditContactNameEmojiView.routeName, - arguments: _contact.id, + arguments: _contact.customId, ); }, style: Theme.of(context) @@ -318,7 +318,7 @@ class _ContactDetailsViewState extends ConsumerState { onTap: () { Navigator.of(context).pushNamed( AddNewContactAddressView.routeName, - arguments: _contact.id, + arguments: _contact.customId, ); }, ), @@ -385,7 +385,7 @@ class _ContactDetailsViewState extends ConsumerState { Navigator.of(context).pushNamed( EditContactAddressView.routeName, - arguments: Tuple2(_contact.id, e), + arguments: Tuple2(_contact.customId, e), ); }, child: RoundedContainer( diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index 88cad7f33..fafebfcb1 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -110,7 +110,7 @@ class ContactPopUp extends ConsumerWidget { .textFieldDefaultBG, borderRadius: BorderRadius.circular(32), ), - child: contact.id == "default" + child: contact.customId == "default" ? Center( child: SvgPicture.file( File( @@ -146,13 +146,13 @@ class ContactPopUp extends ConsumerWidget { STextStyles.itemSubtitle12(context), ), ), - if (contact.id != "default") + if (contact.customId != "default") TextButton( onPressed: () { Navigator.pop(context); Navigator.of(context).pushNamed( ContactDetailsView.routeName, - arguments: contact.id, + arguments: contact.customId, ); }, style: Theme.of(context) @@ -176,7 +176,7 @@ class ContactPopUp extends ConsumerWidget { ), ), SizedBox( - height: contact.id == "default" ? 16 : 8, + height: contact.customId == "default" ? 16 : 8, ), Container( height: 1, @@ -233,14 +233,14 @@ class ContactPopUp extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (contact.id == "default") + if (contact.customId == "default") Text( e.other!, style: STextStyles.itemSubtitle12( context), ), - if (contact.id != "default") + if (contact.customId != "default") Text( "${e.label} (${e.coin.ticker})", style: @@ -336,13 +336,13 @@ class ContactPopUp extends ConsumerWidget { ), ], ), - if (contact.id != "default" && + if (contact.customId != "default" && hasActiveWallet && !isExchangeFlow) const SizedBox( width: 4, ), - if (contact.id != "default" && + if (contact.customId != "default" && hasActiveWallet && !isExchangeFlow) Column( diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart index 453fe1cb2..9e1701fd2 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart @@ -111,7 +111,7 @@ class _DesktopContactDetailsState extends ConsumerState { width: 32, height: 32, decoration: BoxDecoration( - color: contact.id == "default" + color: contact.customId == "default" ? Colors.transparent : Theme.of(context) .extension()!