Snackbar の色を変更。ロゲ開始時のエラーを回避。
This commit is contained in:
@ -198,6 +198,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
// Clear data and start game logic here
|
||||
destinationController.isInRog.value = true;
|
||||
destinationController.resetRogaining();
|
||||
|
||||
destinationController.addToRogaining(
|
||||
destinationController.currentLat,
|
||||
destinationController.currentLon,
|
||||
@ -480,16 +481,37 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
// Finish or Goal
|
||||
getActionButton(context, destination),
|
||||
//remove checkin
|
||||
isAlreadyCheckedIn == true && destination.cp != -1
|
||||
isAlreadyCheckedIn == true && destination.cp != 0 && destination.cp != -1 && destination.cp != -2
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blueAccent),
|
||||
onPressed: () async {
|
||||
await destinationController
|
||||
.removeCheckin(destination.cp!.toInt());
|
||||
destinationController
|
||||
.deleteDestination(destination);
|
||||
Get.back();
|
||||
try {
|
||||
await destinationController
|
||||
.removeCheckin(destination.cp!.toInt());
|
||||
destinationController
|
||||
.deleteDestination(destination);
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
'チェックイン取り消し',
|
||||
'${destination
|
||||
.name}のチェックインは取り消されました',
|
||||
backgroundColor: Colors.green,
|
||||
colorText: Colors.white,
|
||||
duration: Duration(seconds: 3),
|
||||
);
|
||||
} catch (e ) {
|
||||
// エラーハンドリング
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'An error occurred while canceling check-in.',
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
duration: Duration(seconds: 3),
|
||||
);
|
||||
// 必要に応じてエラーログを記録
|
||||
print('Error canceling check-in: $e');
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
"チェックイン取消",
|
||||
|
||||
Reference in New Issue
Block a user