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

@ -12,10 +12,10 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- gallery_saver (0.0.1):
- Flutter
- geolocator_apple (1.2.0): - geolocator_apple (1.2.0):
- Flutter - Flutter
- image_gallery_saver (2.0.2):
- Flutter
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- isar_flutter_libs (1.0.0): - isar_flutter_libs (1.0.0):
@ -41,8 +41,8 @@ DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_compass (from `.symlinks/plugins/flutter_compass/ios`) - flutter_compass (from `.symlinks/plugins/flutter_compass/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- gallery_saver (from `.symlinks/plugins/gallery_saver/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`) - isar_flutter_libs (from `.symlinks/plugins/isar_flutter_libs/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
@ -67,10 +67,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_compass/ios" :path: ".symlinks/plugins/flutter_compass/ios"
flutter_keyboard_visibility: flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios" :path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
gallery_saver:
:path: ".symlinks/plugins/gallery_saver/ios"
geolocator_apple: geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios" :path: ".symlinks/plugins/geolocator_apple/ios"
image_gallery_saver:
:path: ".symlinks/plugins/image_gallery_saver/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
isar_flutter_libs: isar_flutter_libs:
@ -88,13 +88,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855 flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
gallery_saver: 9fc173c9f4fcc48af53b2a9ebea1b643255be542
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073 isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
@ -102,7 +102,7 @@ SPEC CHECKSUMS:
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
PODFILE CHECKSUM: a1c2f8dde3796ecc1697a15e7c75eb5205d8a740 PODFILE CHECKSUM: a1c2f8dde3796ecc1697a15e7c75eb5205d8a740

View File

@ -42,6 +42,8 @@ class DestinationController extends GetxController {
double currentLon = 0.0; double currentLon = 0.0;
DateTime lastGPSCollectedTime = DateTime.now(); DateTime lastGPSCollectedTime = DateTime.now();
bool shouldShowBottomSheet = true;
static bool gps_push_started = false; static bool gps_push_started = false;
static bool game_started = false; static bool game_started = false;
@ -173,15 +175,21 @@ class DestinationController extends GetxController {
if (isPhotoShoot.value == true) { if (isPhotoShoot.value == true) {
photos.clear(); photos.clear();
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!, context: Get.context!,
isScrollControlled: true, isScrollControlled: true,
builder: ((context) => CameraPage(destination: d))).whenComplete(() { builder: ((context) => CameraPage(destination: d)))
.whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} }
@ -195,6 +203,8 @@ class DestinationController extends GetxController {
chekcs = 1; chekcs = 1;
isInCheckin.value = true; isInCheckin.value = true;
isAtStart.value = true; isAtStart.value = true;
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)), BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
@ -203,16 +213,20 @@ class DestinationController extends GetxController {
builder: ((context) => BottomSheetNew( builder: ((context) => BottomSheetNew(
destination: d, destination: d,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isAtStart.value = false; isAtStart.value = false;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} else if (isInRog.value == true && indexController.rogMode.value == 1) { } else if (isInRog.value == true && indexController.rogMode.value == 1) {
// print("----- in location popup checkin cp - ${d.cp}----"); // print("----- in location popup checkin cp - ${d.cp}----");
chekcs = 2; chekcs = 2;
isInCheckin.value = true; isInCheckin.value = true;
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
@ -221,10 +235,12 @@ class DestinationController extends GetxController {
builder: ((context) => BottomSheetNew( builder: ((context) => BottomSheetNew(
destination: d, destination: d,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} }
} }
@ -256,6 +272,8 @@ class DestinationController extends GetxController {
isInCheckin.value = true; isInCheckin.value = true;
photos.clear(); photos.clear();
// print("--- calling checkin ---"); // print("--- calling checkin ---");
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
@ -264,15 +282,19 @@ class DestinationController extends GetxController {
builder: ((context) => CameraPage( builder: ((context) => CameraPage(
destination: d, destination: d,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
rogainingCounted.value = true; rogainingCounted.value = true;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} else if (isInRog.value == true && d.cp != -1) { } else if (isInRog.value == true && d.cp != -1) {
chekcs = 4; chekcs = 4;
isInCheckin.value = true; isInCheckin.value = true;
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showMaterialModalBottomSheet( await showMaterialModalBottomSheet(
expand: true, expand: true,
context: Get.context!, context: Get.context!,
@ -280,10 +302,12 @@ class DestinationController extends GetxController {
builder: (context) => BottomSheetNew( builder: (context) => BottomSheetNew(
destination: d, destination: d,
)).whenComplete(() { )).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} }
} }
@ -298,8 +322,11 @@ class DestinationController extends GetxController {
isInCheckin.value = true; isInCheckin.value = true;
photos.clear(); photos.clear();
//print("--- open buy point $buyPointImageAdded ${d.buypoint_image} ----"); //print("--- open buy point $buyPointImageAdded ${d.buypoint_image} ----");
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
context: Get.context!, context: Get.context!,
isScrollControlled: true, isScrollControlled: true,
builder: ((context) => CameraPage( builder: ((context) => CameraPage(
@ -307,11 +334,13 @@ class DestinationController extends GetxController {
destination: d, destination: d,
dbDest: ds.first, dbDest: ds.first,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
rogainingCounted.value = true; rogainingCounted.value = true;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
}); });
}
return; return;
} }
// print("---- cp --- ${d.cp} -----"); // print("---- cp --- ${d.cp} -----");
@ -331,6 +360,8 @@ class DestinationController extends GetxController {
chekcs = 5; chekcs = 5;
isAtGoal.value = true; isAtGoal.value = true;
photos.clear(); photos.clear();
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
@ -339,10 +370,12 @@ class DestinationController extends GetxController {
builder: ((context) => CameraPage( builder: ((context) => CameraPage(
destination: d, destination: d,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isAtGoal.value = false; isAtGoal.value = false;
}); });
}
return; return;
} else if (isInRog.value == false && } else if (isInRog.value == false &&
indexController.rogMode.value == 1 && indexController.rogMode.value == 1 &&
@ -351,6 +384,8 @@ class DestinationController extends GetxController {
//print("---- in start -----"); //print("---- in start -----");
chekcs = 6; chekcs = 6;
isAtStart.value = true; isAtStart.value = true;
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false;
await showModalBottomSheet( await showModalBottomSheet(
constraints: constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
@ -359,11 +394,13 @@ class DestinationController extends GetxController {
builder: ((context) => BottomSheetNew( builder: ((context) => BottomSheetNew(
destination: d, destination: d,
))).whenComplete(() { ))).whenComplete(() {
shouldShowBottomSheet = true;
//print("----- finished start -------"); //print("----- finished start -------");
skipGps = false; skipGps = false;
chekcs = 0; chekcs = 0;
isAtStart.value = false; isAtStart.value = false;
}); });
}
return; return;
} }
} }