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

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

View File

@ -374,7 +374,14 @@ class BottomSheetNew extends GetView<BottomSheetController> {
// return indexController.rogMode.value == 0
// ? detailsSheet(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("--${destination.cp}--");
return SingleChildScrollView(
child: Column(
children: [

View File

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