diff --git a/assets/images/solid_desktop_menu.png b/assets/images/solid_desktop_menu.png new file mode 100644 index 000000000..d793803da Binary files /dev/null and b/assets/images/solid_desktop_menu.png differ diff --git a/lib/di.dart b/lib/di.dart index 067c2f19b..6180df576 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -8,6 +8,7 @@ import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/src/screens/buy/onramper_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart'; import 'package:cake_wallet/src/screens/settings/display_settings_page.dart'; import 'package:cake_wallet/src/screens/settings/other_settings_page.dart'; import 'package:cake_wallet/src/screens/settings/privacy_page.dart'; @@ -367,6 +368,7 @@ Future setup( BalancePage(dashboardViewModel: getIt.get(), settingsStore: getIt.get())); getIt.registerFactory(() => DashboardPage( balancePage: getIt.get(), walletViewModel: getIt.get(), addressListViewModel: getIt.get())); + getIt.registerFactory(() => TransactionsPage(dashboardViewModel: getIt.get())); getIt.registerFactory(() => ReceivePage( addressListViewModel: getIt.get())); getIt.registerFactory(() => AddressPage( diff --git a/lib/router.dart b/lib/router.dart index 83d247e76..7a0f71e2d 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -6,6 +6,7 @@ import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart'; import 'package:cake_wallet/src/screens/buy/onramper_page.dart'; import 'package:cake_wallet/src/screens/buy/pre_order_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart'; import 'package:cake_wallet/src/screens/settings/desktop_settings/dashboard_settings_page.dart'; import 'package:cake_wallet/src/screens/settings/display_settings_page.dart'; import 'package:cake_wallet/src/screens/settings/other_settings_page.dart'; @@ -526,6 +527,12 @@ Route createRoute(RouteSettings settings) { case Routes.empty_no_route: return MaterialPageRoute( builder: (_) => SizedBox.shrink()); + + case Routes.transactionsPage: + return CupertinoPageRoute( + settings: settings, + fullscreenDialog: true, + builder: (_) => getIt.get()); default: return MaterialPageRoute( diff --git a/lib/routes.dart b/lib/routes.dart index 26bc9b3bb..8bf5603e0 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -84,4 +84,5 @@ class Routes { static const otherSettingsPage = '/other_settings_page'; static const advancedPrivacySettings = '/advanced_privacy_settings'; static const desktop_actions = '/desktop_actions'; + static const transactionsPage = '/transactions_page'; } diff --git a/lib/src/screens/dashboard/desktop_dashboard_page.dart b/lib/src/screens/dashboard/desktop_dashboard_page.dart index 5d529c39b..4b8a4bb44 100644 --- a/lib/src/screens/dashboard/desktop_dashboard_page.dart +++ b/lib/src/screens/dashboard/desktop_dashboard_page.dart @@ -4,6 +4,7 @@ import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart'; import 'package:cake_wallet/src/screens/yat_emoji_id.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/themes/theme_base.dart'; @@ -57,7 +58,25 @@ class DesktopDashboardPage extends BasePage { @override Widget trailing(BuildContext context) { - return Image.asset('assets/images/desktop_menu.png', color: Theme.of(context).highlightColor); + final iconPath = Image.asset('assets/images/solid_desktop_menu.png', + color: Theme.of(context).accentTextTheme.headline2!.backgroundColor!); + return InkWell( + onTap: () { + String? currentPath; + + desktopKey.currentState?.popUntil((route) { + currentPath = route.settings.name; + return true; + }); + + if (currentPath == Routes.transactionsPage) { + return Navigator.pop(desktopKey.currentContext!); + } + + desktopKey.currentState!.pushNamed(Routes.transactionsPage); + }, + child: iconPath, + ); } final BalancePage balancePage; diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart index dccf6c441..7e2bba777 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_view.dart @@ -2,6 +2,8 @@ import 'package:cake_wallet/routes.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/router.dart' as Router; +GlobalKey desktopKey = GlobalKey(); + class DesktopDashboardView extends StatelessWidget { final Widget balancePage; @@ -19,6 +21,7 @@ class DesktopDashboardView extends StatelessWidget { Expanded( flex: 5, child: Navigator( + key: desktopKey, initialRoute: Routes.desktop_actions, onGenerateRoute: (settings) => Router.createRoute(settings), onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {