買い物ポイントでチェックアウトをキャンセルしたらレシート撮影は抑制する
This commit is contained in:
@ -238,15 +238,21 @@ class CameraPage extends StatelessWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await destinationController.makeCheckin(destination, true,
|
await destinationController.makeCheckin(destination, true,
|
||||||
destinationController.photos[0].path);
|
destinationController.photos[0].path);
|
||||||
Get.back();
|
//Get.back();
|
||||||
destinationController.rogainingCounted.value = true;
|
destinationController.rogainingCounted.value = true;
|
||||||
destinationController.skipGps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.isPhotoShoot.value = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
|
|
||||||
Get.snackbar("チェックインしました。",
|
Get.snackbar("チェックインしました。",
|
||||||
"${destination.sub_loc_id} : ${destination.name}",
|
"${destination.sub_loc_id} : ${destination.name}",
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
colorText: Colors.white
|
colorText: Colors.white,
|
||||||
|
duration: const Duration(seconds: 2), // 表示時間を1秒に設定
|
||||||
);
|
);
|
||||||
|
// SnackBarの表示が終了するのを待ってからCameraPageを閉じる
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
|
Navigator.of(context).pop(true); // ここを修正
|
||||||
},
|
},
|
||||||
child: const Text("チェックイン"))
|
child: const Text("チェックイン"))
|
||||||
: Container())
|
: Container())
|
||||||
@ -371,6 +377,7 @@ class CameraPage extends StatelessWidget {
|
|||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
colorText: Colors.white
|
colorText: Colors.white
|
||||||
);
|
);
|
||||||
|
Navigator.of(context).pop(true); // ここを修正
|
||||||
},
|
},
|
||||||
child: const Text("レシートの写真を撮ってください"))
|
child: const Text("レシートの写真を撮ってください"))
|
||||||
: Container())
|
: Container())
|
||||||
@ -438,17 +445,24 @@ class CameraPage extends StatelessWidget {
|
|||||||
indexController.currentDestinationFeature[0],
|
indexController.currentDestinationFeature[0],
|
||||||
true,
|
true,
|
||||||
destinationController.photos[0].path);
|
destinationController.photos[0].path);
|
||||||
Get.back();
|
//Get.back();
|
||||||
destinationController.rogainingCounted.value = true;
|
destinationController.rogainingCounted.value = true;
|
||||||
destinationController.skipGps = false;
|
destinationController.skipGps = false;
|
||||||
destinationController.isPhotoShoot.value = false;
|
destinationController.isPhotoShoot.value = false;
|
||||||
|
|
||||||
|
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"チェックインしました",
|
"チェックインしました",
|
||||||
indexController.currentDestinationFeature[0].name ??
|
indexController.currentDestinationFeature[0].name ??
|
||||||
"",
|
"",
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
colorText: Colors.white
|
colorText: Colors.white,
|
||||||
|
duration: const Duration(seconds: 2), // 表示時間を1秒に設定
|
||||||
);
|
);
|
||||||
|
// SnackBarの表示が終了するのを待ってからCameraPageを閉じる
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
|
Navigator.of(context).pop(true); // ここを修正
|
||||||
},
|
},
|
||||||
child: const Text("チェックイン"))
|
child: const Text("チェックイン"))
|
||||||
: Container())
|
: Container())
|
||||||
|
|||||||
@ -798,8 +798,76 @@ class DestinationController extends GetxController {
|
|||||||
isInRog.value == true &&
|
isInRog.value == true &&
|
||||||
d.cp != -1 && d.cp != 0 && d.cp != -2) {
|
d.cp != -1 && d.cp != 0 && d.cp != -2) {
|
||||||
chekcs = 3;
|
chekcs = 3;
|
||||||
isInCheckin.value = true;
|
|
||||||
photos.clear();
|
photos.clear();
|
||||||
|
isInCheckin.value = true;
|
||||||
|
|
||||||
|
final result = await showModalBottomSheet(
|
||||||
|
constraints:
|
||||||
|
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
|
||||||
|
context: Get.context!,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: ((context) => CameraPage(
|
||||||
|
manulaCheckin: true,
|
||||||
|
destination: d,
|
||||||
|
)));
|
||||||
|
|
||||||
|
if (result ?? false) {
|
||||||
|
debugPrint("==> Checkin complete....");
|
||||||
|
if (d.buy_point != null && d.buy_point! > 0) {
|
||||||
|
skipGps = true;
|
||||||
|
photos.clear();
|
||||||
|
DatabaseHelper db = DatabaseHelper.instance;
|
||||||
|
List<Destination> ds =
|
||||||
|
await db.getDestinationByLatLon(d.lat!, d.lon!);
|
||||||
|
Destination? dss;
|
||||||
|
if (ds.isNotEmpty) {
|
||||||
|
dss = ds.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
await showModalBottomSheet(
|
||||||
|
constraints:
|
||||||
|
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
|
||||||
|
context: Get.context!,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: ((context) =>
|
||||||
|
CameraPage(
|
||||||
|
buyPointPhoto: true,
|
||||||
|
destination: d,
|
||||||
|
dbDest: dss,
|
||||||
|
))).whenComplete(() {
|
||||||
|
skipGps = false;
|
||||||
|
rogainingCounted.value = true;
|
||||||
|
chekcs = 0;
|
||||||
|
isInCheckin.value = false;
|
||||||
|
//Get.back();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
debugPrint("キャンセルされました");
|
||||||
|
Get.snackbar(
|
||||||
|
"キャンセルされました",
|
||||||
|
"チェックインしていません。必要ならもう一度チェックポイントをタップして下さい。",
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
colorText: Colors.black,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
"ロゲが始まっていません",
|
||||||
|
"ロゲ開始ボタンをタップして、ロゲイニングを始める必要があります",
|
||||||
|
backgroundColor: Colors.yellow,
|
||||||
|
colorText: Colors.black,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/*
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
constraints:
|
constraints:
|
||||||
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
|
BoxConstraints.loose(Size(Get.width, Get.height * 0.75)),
|
||||||
@ -855,6 +923,8 @@ class DestinationController extends GetxController {
|
|||||||
// backgroundColor: Colors.yellow,
|
// backgroundColor: Colors.yellow,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user