diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 7416e349d..4d00fbf9d 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; +import 'package:stackwallet/pages/buy_view/buy_view.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'; import 'package:stackwallet/pages/exchange_view/wallet_initiated_exchange_view.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; @@ -772,7 +773,14 @@ class _WalletViewState extends ConsumerState { ), ); }, - onBuyPressed: () {}, + onBuyPressed: () { + // TODO set default coin to currently open wallet + // final coin = ref.read(managerProvider).coin; + + unawaited(Navigator.of(context).pushNamed( + BuyView.routeName, + )); + }, ), ), ], diff --git a/lib/route_generator.dart b/lib/route_generator.dart index af88499ba..3cf4ed716 100644 --- a/lib/route_generator.dart +++ b/lib/route_generator.dart @@ -23,6 +23,7 @@ import 'package:stackwallet/pages/address_book_views/subviews/contact_details_vi import 'package:stackwallet/pages/address_book_views/subviews/edit_contact_address_view.dart'; import 'package:stackwallet/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart'; import 'package:stackwallet/pages/buy_view/buy_quote_preview.dart'; +import 'package:stackwallet/pages/buy_view/buy_view.dart'; import 'package:stackwallet/pages/exchange_view/choose_from_stack_view.dart'; import 'package:stackwallet/pages/exchange_view/edit_trade_note_view.dart'; import 'package:stackwallet/pages/exchange_view/exchange_loading_overlay.dart'; @@ -1125,6 +1126,12 @@ class RouteGenerator { builder: (_) => const DesktopExchangeView(), settings: RouteSettings(name: settings.name)); + case BuyView.routeName: + return getRoute( + shouldUseMaterialRoute: useMaterialPageRoute, + builder: (_) => const BuyView(), + settings: RouteSettings(name: settings.name)); + case DesktopBuyView.routeName: return getRoute( shouldUseMaterialRoute: useMaterialPageRoute,