added cancel buypoints

This commit is contained in:
Mohamed Nouffer
2023-09-15 17:19:26 +05:30
parent a2b055fe8b
commit f760294a39
3 changed files with 31 additions and 4 deletions

View File

@ -150,6 +150,7 @@ class DestinationController extends GetxController {
: false;
bool buyPointImageAdded =
dss != null && dss.buypoint_image != null ? true : false;
bool buyPointCanceled = dss != null && dss.buy_point != null && dss.buy_point == 0 ? true : false;
bool locationAlreadyCheckedIn =
ds.length > 0 && ds[0].checkedin == true ? true : false;
bool isuserLoggedIn = indexController.currentUser.isNotEmpty ? true : false;
@ -296,6 +297,7 @@ class DestinationController extends GetxController {
buyPointImageAdded == false &&
ds.isNotEmpty &&
buyPoint == true &&
buyPointCanceled == false &&
is_in_rog.value == true) {
chekcs = 5;
is_in_checkin.value = true;
@ -616,9 +618,14 @@ class DestinationController extends GetxController {
saveGameState();
}
Future<void> cancelBuyPoint(Destination destination) async {
DatabaseHelper db = DatabaseHelper.instance;
await db.updateCancelBuyPoint(destination);
PopulateDestinations();
}
Future<void> makeBuyPoint(Destination destination, String imageurl) async {
DatabaseHelper db = DatabaseHelper.instance;
await db.updateBuyPoint(destination, imageurl);
PopulateDestinations();
await GallerySaver.saveImage(imageurl);