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();
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), shouldShowBottomSheet = false;
context: Get.context!, await showModalBottomSheet(
isScrollControlled: true, constraints:
builder: ((context) => CameraPage(destination: d))).whenComplete(() { BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
skipGps = false; context: Get.context!,
chekcs = 0; isScrollControlled: true,
isInCheckin.value = false; builder: ((context) => CameraPage(destination: d)))
}); .whenComplete(() {
shouldShowBottomSheet = true;
skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return; return;
} }
@ -195,36 +203,44 @@ class DestinationController extends GetxController {
chekcs = 1; chekcs = 1;
isInCheckin.value = true; isInCheckin.value = true;
isAtStart.value = true; isAtStart.value = true;
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: shouldShowBottomSheet = false;
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)), await showModalBottomSheet(
context: Get.context!, constraints:
isScrollControlled: true, BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
builder: ((context) => BottomSheetNew( context: Get.context!,
destination: d, isScrollControlled: true,
))).whenComplete(() { builder: ((context) => BottomSheetNew(
skipGps = false; destination: d,
chekcs = 0; ))).whenComplete(() {
isAtStart.value = false; shouldShowBottomSheet = true;
isInCheckin.value = false; skipGps = false;
}); chekcs = 0;
isAtStart.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;
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: shouldShowBottomSheet = false;
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), await showModalBottomSheet(
context: Get.context!, constraints:
isScrollControlled: true, BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
builder: ((context) => BottomSheetNew( context: Get.context!,
destination: d, isScrollControlled: true,
))).whenComplete(() { builder: ((context) => BottomSheetNew(
skipGps = false; destination: d,
chekcs = 0; ))).whenComplete(() {
isInCheckin.value = false; shouldShowBottomSheet = true;
}); skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return; return;
} }
} }
@ -256,34 +272,42 @@ class DestinationController extends GetxController {
isInCheckin.value = true; isInCheckin.value = true;
photos.clear(); photos.clear();
// print("--- calling checkin ---"); // print("--- calling checkin ---");
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: shouldShowBottomSheet = false;
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), await showModalBottomSheet(
context: Get.context!, constraints:
isScrollControlled: true, BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
builder: ((context) => CameraPage( context: Get.context!,
destination: d, isScrollControlled: true,
))).whenComplete(() { builder: ((context) => CameraPage(
skipGps = false; destination: d,
rogainingCounted.value = true; ))).whenComplete(() {
chekcs = 0; shouldShowBottomSheet = true;
isInCheckin.value = false; skipGps = false;
}); rogainingCounted.value = true;
chekcs = 0;
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;
await showMaterialModalBottomSheet( if (shouldShowBottomSheet) {
expand: true, shouldShowBottomSheet = false;
context: Get.context!, await showMaterialModalBottomSheet(
backgroundColor: Colors.transparent, expand: true,
builder: (context) => BottomSheetNew( context: Get.context!,
destination: d, backgroundColor: Colors.transparent,
)).whenComplete(() { builder: (context) => BottomSheetNew(
skipGps = false; destination: d,
chekcs = 0; )).whenComplete(() {
isInCheckin.value = false; shouldShowBottomSheet = true;
}); skipGps = false;
chekcs = 0;
isInCheckin.value = false;
});
}
return; return;
} }
} }
@ -298,20 +322,25 @@ 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} ----");
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), shouldShowBottomSheet = false;
context: Get.context!, await showModalBottomSheet(
isScrollControlled: true, constraints:
builder: ((context) => CameraPage( BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
buyPointPhoto: true, context: Get.context!,
destination: d, isScrollControlled: true,
dbDest: ds.first, builder: ((context) => CameraPage(
))).whenComplete(() { buyPointPhoto: true,
skipGps = false; destination: d,
rogainingCounted.value = true; dbDest: ds.first,
chekcs = 0; ))).whenComplete(() {
isInCheckin.value = false; shouldShowBottomSheet = true;
}); skipGps = false;
rogainingCounted.value = true;
chekcs = 0;
isInCheckin.value = false;
});
}
return; return;
} }
// print("---- cp --- ${d.cp} -----"); // print("---- cp --- ${d.cp} -----");
@ -331,18 +360,22 @@ class DestinationController extends GetxController {
chekcs = 5; chekcs = 5;
isAtGoal.value = true; isAtGoal.value = true;
photos.clear(); photos.clear();
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: shouldShowBottomSheet = false;
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), await showModalBottomSheet(
context: Get.context!, constraints:
isScrollControlled: true, BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
builder: ((context) => CameraPage( context: Get.context!,
destination: d, isScrollControlled: true,
))).whenComplete(() { builder: ((context) => CameraPage(
skipGps = false; destination: d,
chekcs = 0; ))).whenComplete(() {
isAtGoal.value = false; shouldShowBottomSheet = true;
}); skipGps = false;
chekcs = 0;
isAtGoal.value = false;
});
}
return; return;
} else if (isInRog.value == false && } else if (isInRog.value == false &&
indexController.rogMode.value == 1 && indexController.rogMode.value == 1 &&
@ -351,19 +384,23 @@ class DestinationController extends GetxController {
//print("---- in start -----"); //print("---- in start -----");
chekcs = 6; chekcs = 6;
isAtStart.value = true; isAtStart.value = true;
await showModalBottomSheet( if (shouldShowBottomSheet) {
constraints: shouldShowBottomSheet = false;
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)), await showModalBottomSheet(
context: Get.context!, constraints:
isScrollControlled: true, BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
builder: ((context) => BottomSheetNew( context: Get.context!,
destination: d, isScrollControlled: true,
))).whenComplete(() { builder: ((context) => BottomSheetNew(
//print("----- finished start -------"); destination: d,
skipGps = false; ))).whenComplete(() {
chekcs = 0; shouldShowBottomSheet = true;
isAtStart.value = false; //print("----- finished start -------");
}); skipGps = false;
chekcs = 0;
isAtStart.value = false;
});
}
return; return;
} }
} }