mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
Keep drawer opened (#1989)
* Keep drawer opened * Pop the side menu only in case of switching wallets
This commit is contained in:
@@ -4,7 +4,6 @@ import 'package:cake_wallet/src/widgets/setting_action_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/setting_actions.dart';
|
||||
import 'package:cake_wallet/typography.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/router.dart' as Router;
|
||||
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
||||
@@ -35,6 +34,7 @@ class _DesktopSettingsPageState extends State<DesktopSettingsPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Row(
|
||||
children: [
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:another_flushbar/flushbar.dart';
|
||||
import 'package:cake_wallet/core/auth_service.dart';
|
||||
import 'package:cake_wallet/core/new_wallet_arguments.dart';
|
||||
import 'package:cake_wallet/core/secure_storage.dart';
|
||||
import 'package:cake_wallet/entities/wallet_edit_page_arguments.dart';
|
||||
import 'package:cake_wallet/entities/wallet_list_order_types.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
@@ -402,41 +401,6 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||
);
|
||||
}
|
||||
|
||||
Image _imageFor({required WalletType type, bool? isTestnet}) {
|
||||
switch (type) {
|
||||
case WalletType.bitcoin:
|
||||
if (isTestnet == true) {
|
||||
return tBitcoinIcon;
|
||||
}
|
||||
return bitcoinIcon;
|
||||
case WalletType.monero:
|
||||
return moneroIcon;
|
||||
case WalletType.litecoin:
|
||||
return litecoinIcon;
|
||||
case WalletType.haven:
|
||||
return havenIcon;
|
||||
case WalletType.ethereum:
|
||||
return ethereumIcon;
|
||||
case WalletType.bitcoinCash:
|
||||
return bitcoinCashIcon;
|
||||
case WalletType.nano:
|
||||
case WalletType.banano:
|
||||
return nanoIcon;
|
||||
case WalletType.polygon:
|
||||
return polygonIcon;
|
||||
case WalletType.solana:
|
||||
return solanaIcon;
|
||||
case WalletType.tron:
|
||||
return tronIcon;
|
||||
case WalletType.wownero:
|
||||
return wowneroIcon;
|
||||
case WalletType.zano:
|
||||
return zanoIcon;
|
||||
case WalletType.none:
|
||||
return nonWalletTypeIcon;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _loadWallet(WalletListItem wallet) async {
|
||||
if (SettingsStoreBase.walletPasswordDirectInput) {
|
||||
Navigator.of(context).pushNamed(Routes.walletUnlockLoadable,
|
||||
|
||||
@@ -46,7 +46,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).silent_payments_settings,
|
||||
image: 'assets/images/bitcoin_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.silentPaymentsSettings);
|
||||
},
|
||||
);
|
||||
@@ -56,7 +55,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).export_outputs,
|
||||
image: 'assets/images/monero_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.urqrAnimatedPage, arguments: 'export-outputs');
|
||||
},
|
||||
);
|
||||
@@ -66,7 +64,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).litecoin_mweb_settings,
|
||||
image: 'assets/images/litecoin_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.mwebSettings);
|
||||
},
|
||||
);
|
||||
@@ -76,7 +73,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).connection_sync,
|
||||
image: 'assets/images/nodes_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.connectionSync);
|
||||
},
|
||||
);
|
||||
@@ -86,8 +82,10 @@ class SettingActions {
|
||||
name: (context) => S.of(context).wallets,
|
||||
image: 'assets/images/wallet_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.walletList);
|
||||
Navigator.of(context).pushNamed(Routes.walletList, arguments: (_) {
|
||||
Navigator.of(context).pop(); // pops wallet list
|
||||
Navigator.of(context).pop(); // pops drawer
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -96,7 +94,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).address_book_menu,
|
||||
image: 'assets/images/open_book_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.addressBook);
|
||||
},
|
||||
);
|
||||
@@ -106,7 +103,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).security_and_backup,
|
||||
image: 'assets/images/key_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.securityBackupPage);
|
||||
},
|
||||
);
|
||||
@@ -116,7 +112,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).privacy,
|
||||
image: 'assets/images/privacy_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.privacyPage);
|
||||
},
|
||||
);
|
||||
@@ -126,7 +121,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).display_settings,
|
||||
image: 'assets/images/eye_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.displaySettingsPage);
|
||||
},
|
||||
);
|
||||
@@ -136,7 +130,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).other_settings,
|
||||
image: 'assets/images/settings_menu.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.otherSettingsPage);
|
||||
},
|
||||
);
|
||||
@@ -146,7 +139,6 @@ class SettingActions {
|
||||
name: (context) => S.of(context).settings_support,
|
||||
image: 'assets/images/question_mark.png',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
Navigator.of(context).pushNamed(Routes.support);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user