diff --git a/lib/buy.dart b/lib/buy.dart index 48c7fe3..f0af5da 100644 --- a/lib/buy.dart +++ b/lib/buy.dart @@ -773,7 +773,7 @@ class _BuyScreenState extends State { // add close button ElevatedButton( onPressed: () async { - Navigator.pop(context); + try { // 1. create payment intent on the server int price = (SellerPrice*100).toInt(); @@ -804,9 +804,9 @@ class _BuyScreenState extends State { ); rethrow; } - + await Stripe.instance.presentPaymentSheet(); - +Navigator.pop(context); }, child: Text(