checkout_form - Linked button to Payment screen
This commit is contained in:
parent
09eabb91eb
commit
08d06f287a
1 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
|||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:nekoya_flutter/api/api.dart';
|
||||
import 'package:nekoya_flutter/data/cart.dart';
|
||||
import 'package:nekoya_flutter/screens/payment.dart';
|
||||
|
||||
class CheckoutForm extends StatefulWidget {
|
||||
const CheckoutForm({Key? key}) : super(key: key);
|
||||
|
@ -233,8 +234,14 @@ class _CheckoutFormState extends State<CheckoutForm> {
|
|||
.fields["Shipping Method"]!.value,
|
||||
"data": cartData,
|
||||
};
|
||||
|
||||
await checkoutPost(data);
|
||||
|
||||
var statusCode = await checkoutPost(data);
|
||||
if (statusCode == 201) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const Payment()));
|
||||
}
|
||||
}
|
||||
},
|
||||
color: const Color(0xff8B0000),
|
||||
|
|
Loading…
Add table
Reference in a new issue