Skip to content

Commit

Permalink
added purchase confirmed popup
Browse files Browse the repository at this point in the history
  • Loading branch information
YannMarti committed May 10, 2022
1 parent 47f24ff commit ebae51d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vidaia/assets/data/rewards.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"name": "5% discount",
"image": "https://magitex.com.ua/image/catalog/goods/Emily/sertifikat-na-skidku-5-na-sleduyushchuyu-pokupku-1612282002.jpg",
"url": "https://cumulus.migros.ch/de.html",
"cost": 25,
"cost": 1,
"description": "Get a voucher for 5% off your next purchase with one of our partner organisations.",
"seller_address": "this is the seller address"
},
Expand Down
6 changes: 4 additions & 2 deletions vidaia/lib/pages/home/redeem/redeem_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,12 @@ class _RedeemInfoPageState extends State<RedeemInfoPage> {
widget.reward.cost.toString() + ' VID',
style: TextStyle(fontSize: 16, color: PRIMARY),
),
onTap: () => transferVidar(
onTap: () { transferVidar(
widget.reward.cost,
'0x00bab3d8de4ebbefb07d53b1ff8c0f2434bd616d',
'https://testnet.veblocks.net'),
'https://testnet.veblocks.net');
confirmPurchase(context);
}
),
),
)
Expand Down
29 changes: 29 additions & 0 deletions vidaia/lib/utils/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,32 @@ showMnemonicWordsAlert(BuildContext context) async {
},
);
}

confirmPurchase(BuildContext context) {
// set up the buttons
Widget cancelButton = TextButton(
child: Text("OK"),
onPressed: () {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context);
},
);

// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: Text("Purchase Confirmed"),
content: Text("Thank you for your purchase. Your Reward will be sent to you by Email."),
actions: [
cancelButton,
],
);
// show the dialog
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return alert;
},
);
}

0 comments on commit ebae51d

Please sign in to comment.