OnPay operations
This commit is contained in:
@@ -3,7 +3,12 @@ import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:gymlink_module_web/components/app_bar.dart';
|
||||
import 'package:gymlink_module_web/components/heading.dart';
|
||||
import 'package:gymlink_module_web/components/order_confirm_item_card.dart';
|
||||
import 'package:gymlink_module_web/pages/order_history.dart';
|
||||
import 'package:gymlink_module_web/providers/cart.dart';
|
||||
import 'package:gymlink_module_web/tools/prefs.dart';
|
||||
import 'package:gymlink_module_web/tools/routes.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
List<Map<String, dynamic>> cart = [
|
||||
{
|
||||
@@ -71,6 +76,13 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _goToPage() async {
|
||||
final Uri url = Uri.parse('https://google.com');
|
||||
if (!await launchUrl(url, webOnlyWindowName: '_blank')) {
|
||||
throw 'Could not launch $url';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -140,17 +152,15 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
debugPrint('debugprint');
|
||||
// if (kIsWeb) {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const OrderPayPage(),
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// debugPrint('test');
|
||||
// }
|
||||
onPressed: () async {
|
||||
_goToPage();
|
||||
await clearCart();
|
||||
Provider.of<CartProvider>(context, listen: false)
|
||||
.updateCartLength();
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
CustomPageRoute(
|
||||
builder: (context) => const HistoryPage()),
|
||||
(route) => route.isFirst);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
|
||||
Reference in New Issue
Block a user