From f81cfa4b0c274dcde4cd0ec58152d29b3bab8bb9 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Thu, 25 Jul 2024 12:02:25 +0545 Subject: [PATCH] feat: Update UI for remove account and bug fix #2065 --- .../crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart | 6 ++++-- .../manage_accounts/view/manage_accounts_page.dart | 5 +++-- lib/wallet/cubit/wallet_cubit.dart | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart index 01dd3ab6f..1b49dfece 100644 --- a/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart +++ b/lib/dashboard/crypto_account_switcher/crypto_bottom_sheet/view/crypto_bottom_sheet_view.dart @@ -180,12 +180,14 @@ class _CryptoBottomSheetPageState extends State { dragDismissible: false, children: [ SlidableAction( - backgroundColor: Colors.red, + backgroundColor: + Colors.transparent, foregroundColor: Theme.of(context) .colorScheme - .primary, + .onSurface, icon: Icons.delete, + label: l10n.delete, onPressed: (_) async { // cannot delete current account final currentIndex = diff --git a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart index 8e8ad4db2..0f4b61385 100644 --- a/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart +++ b/lib/dashboard/drawer/blockchain_settings/manage_accounts/view/manage_accounts_page.dart @@ -135,10 +135,11 @@ class _ManageAccountsPageState extends State { dragDismissible: false, children: [ SlidableAction( - backgroundColor: Colors.red, + backgroundColor: Colors.transparent, foregroundColor: - Theme.of(context).colorScheme.primary, + Theme.of(context).colorScheme.onSurface, icon: Icons.delete, + label: l10n.delete, onPressed: (_) async { // cannot delete current account final currentIndex = diff --git a/lib/wallet/cubit/wallet_cubit.dart b/lib/wallet/cubit/wallet_cubit.dart index 60abaa80d..b22a5fff5 100644 --- a/lib/wallet/cubit/wallet_cubit.dart +++ b/lib/wallet/cubit/wallet_cubit.dart @@ -512,7 +512,7 @@ class WalletCubit extends Cubit { account.walletAddress == currentCryptoAccountData.walletAddress && account.blockchainType == currentCryptoAccountData.blockchainType, ); - emit(state.copyWith(currentCryptoIndex: newIndex)); + await setCurrentWalletAccount(newIndex); emitCryptoAccount(cryptoAccount);