mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 18:44:31 +00:00
pushNamed navigation route, WIP
This commit is contained in:
parent
8ddc825ea5
commit
824b3bb9a7
3 changed files with 8 additions and 6 deletions
|
@ -4,6 +4,8 @@ import 'package:stackwallet/pages/buy_view/buy_form.dart';
|
||||||
class BuyView extends StatefulWidget {
|
class BuyView extends StatefulWidget {
|
||||||
const BuyView({Key? key}) : super(key: key);
|
const BuyView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const String routeName = "/stackBuyView";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BuyView> createState() => _BuyViewState();
|
State<BuyView> createState() => _BuyViewState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:stackwallet/models/buy/response_objects/order.dart';
|
import 'package:stackwallet/models/buy/response_objects/order.dart';
|
||||||
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
import 'package:stackwallet/models/buy/response_objects/quote.dart';
|
||||||
|
import 'package:stackwallet/pages/buy_view/buy_view.dart';
|
||||||
|
import 'package:stackwallet/pages_desktop_specific/desktop_buy/desktop_buy_view.dart';
|
||||||
import 'package:stackwallet/services/buy/buy_response.dart';
|
import 'package:stackwallet/services/buy/buy_response.dart';
|
||||||
import 'package:stackwallet/services/buy/simplex/simplex_api.dart';
|
import 'package:stackwallet/services/buy/simplex/simplex_api.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
|
@ -46,14 +48,12 @@ class BuyWarningPopup extends StatelessWidget {
|
||||||
label: "Continue",
|
label: "Continue",
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
BuyResponse<SimplexOrder> order = await newOrder(quote);
|
BuyResponse<SimplexOrder> order = await newOrder(quote);
|
||||||
// BuyResponse<bool> response =
|
|
||||||
// await redirect(order.value as SimplexOrder);
|
|
||||||
// // TODO save order
|
|
||||||
// Navigator.of(context, rootNavigator: isDesktop).pop;
|
|
||||||
BuyResponse<bool> response =
|
BuyResponse<bool> response =
|
||||||
await redirect(order.value as SimplexOrder).then((order) {
|
await redirect(order.value as SimplexOrder).then((order) {
|
||||||
// TODO save order
|
// TODO save order
|
||||||
Navigator.of(context, rootNavigator: isDesktop).pop;
|
Navigator.of(context, rootNavigator: isDesktop).pushNamed(
|
||||||
|
isDesktop ? DesktopBuyView.routeName : BuyView.routeName,
|
||||||
|
); // TODO fix this for desktop, test for mobile. popUntil?
|
||||||
return order;
|
return order;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@ import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
class DesktopBuyView extends StatefulWidget {
|
class DesktopBuyView extends StatefulWidget {
|
||||||
const DesktopBuyView({Key? key}) : super(key: key);
|
const DesktopBuyView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
static const String routeName = "/desktopBuy";
|
static const String routeName = "/desktopBuyView";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<DesktopBuyView> createState() => _DesktopBuyViewState();
|
State<DesktopBuyView> createState() => _DesktopBuyViewState();
|
||||||
|
|
Loading…
Reference in a new issue