mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
CAKE-126 | added seed item to wallet_keys_view_model; changed title of wallet_keys_page; created wallet menu item; applied wallet menu item to wallet menu; removed show seed item from wallet menu
This commit is contained in:
parent
ca5b4c7cc7
commit
753e898112
5 changed files with 48 additions and 34 deletions
|
@ -1,7 +1,7 @@
|
|||
import 'package:cake_wallet/src/screens/dashboard/wallet_menu_item.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
||||
|
@ -11,26 +11,35 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
|||
class WalletMenu {
|
||||
WalletMenu(this.context, this.reconnect);
|
||||
|
||||
final List<String> items = [
|
||||
S.current.reconnect,
|
||||
S.current.rescan,
|
||||
S.current.wallets,
|
||||
S.current.nodes,
|
||||
S.current.show_seed,
|
||||
S.current.show_keys,
|
||||
S.current.address_book_menu,
|
||||
S.current.settings_title
|
||||
];
|
||||
|
||||
final List<Image> images = [
|
||||
Image.asset('assets/images/reconnect_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/filter_icon.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/wallet_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/nodes_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/eye_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/key_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/open_book_menu.png', height: 16, width: 16),
|
||||
Image.asset('assets/images/settings_menu.png', height: 16, width: 16),
|
||||
final List<WalletMenuItem> items = [
|
||||
WalletMenuItem(
|
||||
title: S.current.reconnect,
|
||||
image: Image.asset('assets/images/reconnect_menu.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.rescan,
|
||||
image: Image.asset('assets/images/filter_icon.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.wallets,
|
||||
image: Image.asset('assets/images/wallet_menu.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.nodes,
|
||||
image: Image.asset('assets/images/nodes_menu.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.show_keys,
|
||||
image: Image.asset('assets/images/key_menu.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.address_book_menu,
|
||||
image: Image.asset('assets/images/open_book_menu.png',
|
||||
height: 16, width: 16)),
|
||||
WalletMenuItem(
|
||||
title: S.current.settings_title,
|
||||
image: Image.asset('assets/images/settings_menu.png',
|
||||
height: 16, width: 16)),
|
||||
];
|
||||
|
||||
final BuildContext context;
|
||||
|
@ -51,14 +60,6 @@ class WalletMenu {
|
|||
Navigator.of(context).pushNamed(Routes.nodeList);
|
||||
break;
|
||||
case 4:
|
||||
Navigator.of(context).pushNamed(Routes.auth,
|
||||
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
||||
isAuthenticatedSuccessfully
|
||||
? Navigator.of(auth.context).popAndPushNamed(Routes.seed, arguments: false)
|
||||
: null);
|
||||
|
||||
break;
|
||||
case 5:
|
||||
Navigator.of(context).pushNamed(Routes.auth,
|
||||
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
|
||||
isAuthenticatedSuccessfully
|
||||
|
@ -66,10 +67,10 @@ class WalletMenu {
|
|||
.popAndPushNamed(Routes.showKeys)
|
||||
: null);
|
||||
break;
|
||||
case 6:
|
||||
case 5:
|
||||
Navigator.of(context).pushNamed(Routes.addressBook);
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
Navigator.of(context).pushNamed(Routes.settings);
|
||||
break;
|
||||
default:
|
||||
|
|
10
lib/src/screens/dashboard/wallet_menu_item.dart
Normal file
10
lib/src/screens/dashboard/wallet_menu_item.dart
Normal file
|
@ -0,0 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class WalletMenuItem {
|
||||
WalletMenuItem({
|
||||
@required this.title,
|
||||
@required this.image});
|
||||
|
||||
final String title;
|
||||
final Image image;
|
||||
}
|
|
@ -168,7 +168,8 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
index--;
|
||||
|
||||
final item = walletMenu.items[index];
|
||||
final image = walletMenu.images[index] ?? Offstage();
|
||||
final title = item.title;
|
||||
final image = item.image ?? Offstage();
|
||||
final isLastTile = index == itemCount - 1;
|
||||
|
||||
return GestureDetector(
|
||||
|
@ -199,7 +200,7 @@ class MenuWidgetState extends State<MenuWidget> {
|
|||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item,
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
|
|
|
@ -13,7 +13,7 @@ class WalletKeysPage extends BasePage {
|
|||
WalletKeysPage(this.walletKeysViewModel);
|
||||
|
||||
@override
|
||||
String get title => S.current.wallet_keys;
|
||||
String get title => 'Wallet seed/keys';
|
||||
|
||||
final WalletKeysViewModel walletKeysViewModel;
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ abstract class WalletKeysViewModelBase with Store {
|
|||
title: S.current.view_key_public, value: keys.publicViewKey),
|
||||
StandartListItem(
|
||||
title: S.current.view_key_private, value: keys.privateViewKey),
|
||||
StandartListItem(
|
||||
title: 'Wallet seed', value: wallet.seed),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue