#2832 まで解決

This commit is contained in:
2024-04-20 12:34:49 +09:00
parent 797f01f76b
commit 33bd2b97a1
18 changed files with 517 additions and 147 deletions

View File

@ -128,14 +128,13 @@ class BottomSheetNew extends GetView<BottomSheetController> {
// ボタンがタップされたときの処理も含まれています。
//
Widget getActionButton(BuildContext context, Destination destination) {
assert(() {
print("getActionButton ${destinationController.rogainingCounted.value}");
print("getActionButton ${destinationController.distanceToStart()}");
print("getActionButton ${destination.cp}");
print("getActionButton ${DestinationController.ready_for_goal}");
return true;
}());
/*
debugPrint("getActionButton ${destinationController.rogainingCounted.value}");
debugPrint("getActionButton ${destinationController.distanceToStart()}");
debugPrint("getActionButton ${destination.cp}");
debugPrint("getActionButton ${DestinationController.ready_for_goal}");
// ...2024-04-03 Akira デバッグモードのみ出力するようにした。
*/
Destination cdest = destinationController
.festuretoDestination(indexController.currentFeature[0]);
@ -176,7 +175,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
}
: null,
child: const Text(
"ロゲイニングを終える",
"ロゲゴール",
style: TextStyle(color: Colors.white),
));
} else if (distanceToDest <=
@ -186,7 +185,26 @@ class BottomSheetNew extends GetView<BottomSheetController> {
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.secondary,
),
onPressed: () async {
onPressed: isAlreadyCheckedIn == true
? null
: () async {
try{
Get.back();
await destinationController.callforCheckin(destination);
} catch (e) {
// エラーハンドリング
Get.snackbar(
'Error',
'An error occurred while processing check-in.',
backgroundColor: Colors.red,
colorText: Colors.white,
duration: Duration(seconds: 3),
);
// 必要に応じてエラーログを記録
print('Error processing check-in: $e');
}
},
/*
// Check conditions to show confirmation dialog
if (destinationController.isInRog.value == false &&
(destinationController.distanceToStart() <= 500 || destinationController.isGpsSignalWeak() ) && //追加 Akira 2024-4-5
@ -239,6 +257,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
return;
}
},
*/
child: Text(
destination.cp == -1 &&
destinationController.isInRog.value == false &&
@ -251,7 +270,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
? "ゲーム中"
: destinationController.isInRog.value == true
? "チェックイン"
: "始まっていない",
: "ロゲは始まっていません",
style: TextStyle(color: Theme.of(context).colorScheme.onSecondary),
),
);