チェッキン中に自動ポップアップを抑制

This commit is contained in:
2024-04-24 22:54:27 +09:00
parent 8945748d07
commit 5d6fd72df6
3 changed files with 23 additions and 3 deletions

View File

@ -113,6 +113,8 @@ class DestinationController extends GetxController {
bool isPopupShown = false; bool isPopupShown = false;
bool hasReceivedGPSData = false; bool hasReceivedGPSData = false;
var isCheckingIn = false.obs; // チェックイン操作中はtrueになり、重複してポップアップが出ないようにするもの。
/* /*
//==== Akira .. GPS信号シミュレーション用 ===== ここから、2024-4-5 //==== Akira .. GPS信号シミュレーション用 ===== ここから、2024-4-5
// //
@ -324,7 +326,7 @@ class DestinationController extends GetxController {
bool isuserLoggedIn = indexController.currentUser.isNotEmpty ? true : false; // ログイン済みか bool isuserLoggedIn = indexController.currentUser.isNotEmpty ? true : false; // ログイン済みか
// 初期化。GPS信号が強くても弱くても // 初期化。GPS信号が強くても弱くても
if (checkinRadious >= distance || checkinRadious == -1) { // 反応半径内か、-1(=距離を無視) if (checkinRadious >= distance || checkinRadious == -1) {
//currentSelectedDestinations.add(d); //currentSelectedDestinations.add(d);
// 目的地として登録する。 // 目的地として登録する。
//debugPrint("目的地の初期化"); //debugPrint("目的地の初期化");
@ -476,7 +478,8 @@ class DestinationController extends GetxController {
// print("---- already checked in $locationAlreadyCheckedIn ----"); // print("---- already checked in $locationAlreadyCheckedIn ----");
if ((checkinRadious >= distance || checkinRadious == -1) && if ((checkinRadious >= distance || checkinRadious == -1) &&
locationAlreadyCheckedIn == false && locationAlreadyCheckedIn == false &&
isInRog.value == true) { isInRog.value == true &&
!isCheckingIn.value) {
debugPrint("* 検知範囲または距離無視CPで、ゲーム中でまだチェックインしていない。"); debugPrint("* 検知範囲または距離無視CPで、ゲーム中でまだチェックインしていない。");
@ -508,6 +511,7 @@ class DestinationController extends GetxController {
chekcs = 3; chekcs = 3;
isInCheckin.value = true; isInCheckin.value = true;
isCheckingIn.value = true;
photos.clear(); photos.clear();
// print("--- calling checkin ---"); // print("--- calling checkin ---");
if (shouldShowBottomSheet) { if (shouldShowBottomSheet) {
@ -525,6 +529,7 @@ class DestinationController extends GetxController {
rogainingCounted.value = true; rogainingCounted.value = true;
chekcs = 0; chekcs = 0;
isInCheckin.value = false; isInCheckin.value = false;
isCheckingIn.value = false;
}); });
} }
return; return;

View File

@ -374,7 +374,14 @@ class BottomSheetNew extends GetView<BottomSheetController> {
// return indexController.rogMode.value == 0 // return indexController.rogMode.value == 0
// ? detailsSheet(context) // ? detailsSheet(context)
// : destinationSheet(context); // : destinationSheet(context);
return detailsSheet(context);
return Obx(() {
if (!destinationController.isCheckingIn.value) {
return detailsSheet(context);
} else {
return Container(); // チェックイン操作中は空のコンテナを返す
}
});
} }
// 指定された目的地がすでにチェックイン済みかどうかを確認するメソッドです。 // 指定された目的地がすでにチェックイン済みかどうかを確認するメソッドです。
@ -412,6 +419,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
LogManager().addLog("Checkin radius : ${destination.checkin_radious}"); LogManager().addLog("Checkin radius : ${destination.checkin_radious}");
LogManager().addLog("--${destination.cp}--"); LogManager().addLog("--${destination.cp}--");
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
children: [ children: [

View File

@ -53,6 +53,13 @@ class _MapWidgetState extends State<MapWidget> with WidgetsBindingObserver {
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
_startIdleTimer(); _startIdleTimer();
// マップの操作イベントをリッスンして、_resetTimerを呼び出す
mapController.mapEventStream.listen((MapEvent mapEvent) {
if (mapEvent is MapEventMove || mapEvent is MapEventFlingAnimation) {
_resetTimer();
}
});
// MapControllerの初期化が完了するまで待機 // MapControllerの初期化が完了するまで待機
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {