fixed multi popup on camera page

This commit is contained in:
2023-12-18 09:22:18 +05:30
parent 445c53d21b
commit 9145e0e27d
2 changed files with 142 additions and 105 deletions

View File

@ -42,6 +42,8 @@ class DestinationController extends GetxController {
double currentLon = 0.0;
DateTime lastGPSCollectedTime = DateTime.now();
bool shouldShowBottomSheet = true;
static bool gps_push_started = false;
static bool game_started = false;
@ -173,15 +175,21 @@ class DestinationController extends GetxController {
if (isPhotoShoot.value == true) {
photos.clear();
await showModalBottomSheet(
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(destination: d))).whenComplete(() {
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(destination: d)))
.whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return;
}
@ -195,36 +203,44 @@ class DestinationController extends GetxController {
chekcs = 1;
isInCheckin.value = true;
isAtStart.value = true;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
skipGps = false;
chekcs = 0;
isAtStart.value = false;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isAtStart.value = false;
isInCheckin.value = false;
});
}
return;
} else if (isInRog.value == true && indexController.rogMode.value == 1) {
// print("----- in location popup checkin cp - ${d.cp}----");
chekcs = 2;
isInCheckin.value = true;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return;
}
}
@ -256,34 +272,42 @@ class DestinationController extends GetxController {
isInCheckin.value = true;
photos.clear();
// print("--- calling checkin ---");
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
destination: d,
))).whenComplete(() {
skipGps = false;
rogainingCounted.value = true;
chekcs = 0;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
destination: d,
))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
rogainingCounted.value = true;
chekcs = 0;
isInCheckin.value = false;
});
}
return;
} else if (isInRog.value == true && d.cp != -1) {
chekcs = 4;
isInCheckin.value = true;
await showMaterialModalBottomSheet(
expand: true,
context: Get.context!,
backgroundColor: Colors.transparent,
builder: (context) => BottomSheetNew(
destination: d,
)).whenComplete(() {
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showMaterialModalBottomSheet(
expand: true,
context: Get.context!,
backgroundColor: Colors.transparent,
builder: (context) => BottomSheetNew(
destination: d,
)).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return;
}
}
@ -298,20 +322,25 @@ class DestinationController extends GetxController {
isInCheckin.value = true;
photos.clear();
//print("--- open buy point $buyPointImageAdded ${d.buypoint_image} ----");
await showModalBottomSheet(
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
buyPointPhoto: true,
destination: d,
dbDest: ds.first,
))).whenComplete(() {
skipGps = false;
rogainingCounted.value = true;
chekcs = 0;
isInCheckin.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
buyPointPhoto: true,
destination: d,
dbDest: ds.first,
))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
rogainingCounted.value = true;
chekcs = 0;
isInCheckin.value = false;
});
}
return;
}
// print("---- cp --- ${d.cp} -----");
@ -331,18 +360,22 @@ class DestinationController extends GetxController {
chekcs = 5;
isAtGoal.value = true;
photos.clear();
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
destination: d,
))).whenComplete(() {
skipGps = false;
chekcs = 0;
isAtGoal.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => CameraPage(
destination: d,
))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isAtGoal.value = false;
});
}
return;
} else if (isInRog.value == false &&
indexController.rogMode.value == 1 &&
@ -351,19 +384,23 @@ class DestinationController extends GetxController {
//print("---- in start -----");
chekcs = 6;
isAtStart.value = true;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
//print("----- finished start -------");
skipGps = false;
chekcs = 0;
isAtStart.value = false;
});
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => BottomSheetNew(
destination: d,
))).whenComplete(() {
shouldShowBottomSheet = true;
//print("----- finished start -------");
skipGps = false;
chekcs = 0;
isAtStart.value = false;
});
}
return;
}
}