From 9c66dffe69447e4a2767eccb4f1a26db778076b3 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Fri, 24 Nov 2023 12:08:02 +0530 Subject: [PATCH] removed distance to checkin --- lib/pages/drawer/drawer_page.dart | 8 +-- lib/widgets/bottom_sheet_new.dart | 98 ++++++++++++++----------------- 2 files changed, 46 insertions(+), 60 deletions(-) diff --git a/lib/pages/drawer/drawer_page.dart b/lib/pages/drawer/drawer_page.dart index d771fd0..ef33299 100644 --- a/lib/pages/drawer/drawer_page.dart +++ b/lib/pages/drawer/drawer_page.dart @@ -137,12 +137,8 @@ class DrawerPage extends StatelessWidget { onTap: () { String token = indexController.currentUser[0]['token']; AuthService.deleteUser(token).then((value) { - if (value.isNotEmpty) { - indexController.logout(); - Get.toNamed(AppPages.TRAVEL); - Get.snackbar("ユーザーデータを削除する", - "データを削除するためにユーザーの同意が設定されています アプリとサーバーでユーザーデータが削除されました"); - } + Get.snackbar("ユーザーデータを削除する", + "データを削除するためにユーザーの同意が設定されています アプリとサーバーでユーザーデータが削除されました"); }); }, ) diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index b6a13df..dbfba71 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -604,65 +604,55 @@ class BottomSheetNew extends GetView { ), // forced start / checkin - Obx( - () => distanceToDest <= + Obx(() => ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: + Theme.of(context).colorScheme.secondary), + onPressed: () async { + //print("~~~~ manual checkin button ~~~~"); + if (destination.cp == -1 && + destinationController.isInRog.value == + false && destinationController - .getForcedChckinDistance(destination) - ? ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Theme.of(context) - .colorScheme - .secondary), - onPressed: () async { - //print("~~~~ manual checkin button ~~~~"); - if (destination.cp == -1 && + .rogainingCounted.value == + false) { + destinationController.isInRog.value = true; + destinationController.addToRogaining( + destinationController.currentLat, + destinationController.currentLon, + destination.location_id!); + saveGameState(); + ExternalService() + .startRogaining() + .then((value) => Get.back()); + } else { + if (destination.cp == -1) { + return; + } + Get.back(); + await destinationController + .callforCheckin(destination); + } + }, + child: Text( + destination.cp == -1 && destinationController.isInRog.value == false && destinationController .rogainingCounted.value == - false) { - destinationController.isInRog.value = - true; - destinationController.addToRogaining( - destinationController.currentLat, - destinationController.currentLon, - destination.location_id!); - saveGameState(); - ExternalService() - .startRogaining() - .then((value) => Get.back()); - } else { - if (destination.cp == -1) { - return; - } - Get.back(); - await destinationController - .callforCheckin(destination); - } - }, - child: Text( - destination.cp == -1 && - destinationController - .isInRog.value == - false && - destinationController - .rogainingCounted.value == - false - ? "ロゲ開始" - : destinationController - .isInRog.value == - true && - destination.cp == -1 - ? "ゲーム中" - : isAlreadyCheckedIn == true - ? "ゲーム中" - : "チェックイン", - style: TextStyle( - color: Theme.of(context) - .colorScheme - .onSecondary))) - : Container(), - ) + false + ? "ロゲ開始" + : destinationController.isInRog.value == + true && + destination.cp == -1 + ? "ゲーム中" + : isAlreadyCheckedIn == true + ? "ゲーム中" + : "チェックイン", + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onSecondary)))) // ElevatedButton( // onPressed: () {}, child: const Text("ゲーム中")), ],