This commit is contained in:
2023-02-26 17:37:04 -05:00
parent 9efce3ae85
commit 253940ae1e

View File

@@ -363,9 +363,7 @@ class _BuyScreenState extends State<BuyScreen> {
Flexible(flex: 2, child: ElevatedButton(onPressed: () {}, child: const Icon(Icons.filter_list)))
]),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Container(
padding: EdgeInsets.only(left: 10, bottom: 10),
child: Text(
@@ -384,7 +382,6 @@ class _BuyScreenState extends State<BuyScreen> {
),
),
)
]),
Expanded(
child: ListView.builder(
@@ -407,8 +404,7 @@ class _BuyScreenState extends State<BuyScreen> {
return InkWell(
onTap: () {
showSheet(context, index, sellerName, price, data[index].availableTime.startTime.toDate(), data[index % data.length].availableTime.endTime.toDate(),
_selectedLocation);
showSheet(context, index, sellerName, price, data[index].availableTime.startTime.toDate(), data[index % data.length].availableTime.endTime.toDate(), _selectedLocation);
// showDialog(
// context: context,
// builder: (BuildContext context) => Dialog(
@@ -773,7 +769,6 @@ class _BuyScreenState extends State<BuyScreen> {
// add close button
ElevatedButton(
onPressed: () async {
try {
// 1. create payment intent on the server
int price = (SellerPrice * 100).toInt();
@@ -797,7 +792,6 @@ class _BuyScreenState extends State<BuyScreen> {
style: ThemeMode.dark,
),
);
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Error: $e')),
@@ -807,7 +801,28 @@ class _BuyScreenState extends State<BuyScreen> {
await Stripe.instance.presentPaymentSheet();
Navigator.pop(context);
showDialog<String>(
context: context,
builder: (BuildContext context) => Dialog(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Your payment has gone through.'),
const SizedBox(height: 15),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('Close'),
),
],
),
),
),
);
},
child: Text(
"Purchase",