From 9a0de2e7f620bc0c989b5bf8dd449015312ad20b Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 20 Jan 2023 10:32:26 -0600 Subject: [PATCH] fix nav pop desktop issue --- lib/pages/buy_view/sub_widgets/buy_warning_popup.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart index 1f5b36c2d..51cfe20dc 100644 --- a/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart +++ b/lib/pages/buy_view/sub_widgets/buy_warning_popup.dart @@ -8,6 +8,7 @@ import 'package:stackwallet/models/buy/response_objects/quote.dart'; import 'package:stackwallet/services/buy/buy_response.dart'; import 'package:stackwallet/services/buy/simplex/simplex_api.dart'; import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -19,6 +20,7 @@ class BuyWarningPopup extends StatelessWidget { }) : super(key: key); final SimplexQuote quote; + final isDesktop = Util.isDesktop; Future> newOrder(SimplexQuote quote) async { return SimplexAPI.instance.newOrder(quote); @@ -37,7 +39,7 @@ class BuyWarningPopup extends StatelessWidget { "their instructions.", leftButton: SecondaryButton( label: "Cancel", - onPressed: Navigator.of(context).pop, + onPressed: Navigator.of(context, rootNavigator: isDesktop).pop, ), rightButton: PrimaryButton( label: "Continue",