mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
dialgo
This commit is contained in:
33
lib/buy.dart
33
lib/buy.dart
@@ -363,9 +363,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
Flexible(flex: 2, child: ElevatedButton(onPressed: () {}, child: const Icon(Icons.filter_list)))
|
Flexible(flex: 2, child: ElevatedButton(onPressed: () {}, child: const Icon(Icons.filter_list)))
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
Row(
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10, bottom: 10),
|
padding: EdgeInsets.only(left: 10, bottom: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -384,7 +382,6 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
]),
|
]),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -407,8 +404,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showSheet(context, index, sellerName, price, data[index].availableTime.startTime.toDate(), data[index % data.length].availableTime.endTime.toDate(),
|
showSheet(context, index, sellerName, price, data[index].availableTime.startTime.toDate(), data[index % data.length].availableTime.endTime.toDate(), _selectedLocation);
|
||||||
_selectedLocation);
|
|
||||||
// showDialog(
|
// showDialog(
|
||||||
// context: context,
|
// context: context,
|
||||||
// builder: (BuildContext context) => Dialog(
|
// builder: (BuildContext context) => Dialog(
|
||||||
@@ -773,7 +769,6 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
// add close button
|
// add close button
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. create payment intent on the server
|
// 1. create payment intent on the server
|
||||||
int price = (SellerPrice * 100).toInt();
|
int price = (SellerPrice * 100).toInt();
|
||||||
@@ -797,7 +792,6 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
style: ThemeMode.dark,
|
style: ThemeMode.dark,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text('Error: $e')),
|
SnackBar(content: Text('Error: $e')),
|
||||||
@@ -807,7 +801,28 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
|
|
||||||
await Stripe.instance.presentPaymentSheet();
|
await Stripe.instance.presentPaymentSheet();
|
||||||
Navigator.pop(context);
|
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(
|
child: Text(
|
||||||
"Purchase",
|
"Purchase",
|
||||||
|
Reference in New Issue
Block a user