手戻り修正、APK出力

This commit is contained in:
2024-04-24 11:30:38 +09:00
parent 4d40a10f9a
commit 8945748d07
9 changed files with 213 additions and 52 deletions

View File

@ -32,6 +32,7 @@ import 'package:rogapp/widgets/debug_widget.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:image_gallery_saver/image_gallery_saver.dart';
import 'package:rogapp/utils/const.dart';
// 目的地に関連する状態管理とロジックを担当するクラスです。
//
@ -405,30 +406,35 @@ class DestinationController extends GetxController {
// print("~~~~ calling start ~~~~");
print("---- in start -----");
chekcs = 1; // スタート地点で前のゴールから24時間経過
chekcs = 1; // スタート地点で前のゴールから24時間経過
isInCheckin.value = true;
isAtStart.value = true;
if (shouldShowBottomSheet) {
shouldShowBottomSheet = false; // bottom_sheet を起動させない。
shouldShowBottomSheet = false; // bottom_sheet を起動させない。
Widget bottomSheet = BottomSheetNew(destination: d);
await showModalBottomSheet(
constraints:
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
BoxConstraints.loose(Size(Get.width, Get.height * 0.85)),
context: Get.context!,
isScrollControlled: true,
builder: ((context) => bottomSheet)
).whenComplete(() {
shouldShowBottomSheet = true; // bottom_sheet 起動許可
skipGps = false;
chekcs = 0; // ボトムシートモード=1,
chekcs = 0; // ボトムシートモード=1,
isAtStart.value = false;
isInCheckin.value = false;
});
}
return;
// 以下の条件分岐を追加
} else if (ds.isNotEmpty && ds[0].checkedin == true) {
// 目的地がDBに存在し、すでにチェックインしている場合は自動ポップアップを表示しない
debugPrint("チェックイン済み");
return;
} else if (isInRog.value == true &&
indexController.rogMode.value == 1 &&
@ -597,7 +603,7 @@ class DestinationController extends GetxController {
// print(
// "==== date diff is ${DateTime.now().difference(last_goal_at).inHours} ====");
if (isuserLoggedIn &&
(d.cp == -2 || d.cp == 0 ) && // Goal CP
(d.cp == -2 || d.cp == 0 || d.cp == -1 ) && // Goal CP
locationAlreadyCheckedIn &&
skip_10s == false) {
//check for rogaining
@ -763,7 +769,7 @@ class DestinationController extends GetxController {
if (autoCheckin) {
if (!checkingIn) {
makeCheckin(d, true, "");
if (d.cp != -1) {
if (d.cp != -1 && d.cp != 0 && d.cp != -2) {
rogainingCounted.value = true;
}
}
@ -774,7 +780,7 @@ class DestinationController extends GetxController {
if (d.hidden_location != null &&
d.hidden_location == 0 &&
isInRog.value == true &&
d.cp != -1) {
d.cp != -1 && d.cp != 0 && d.cp != -2) {
chekcs = 3;
isInCheckin.value = true;
photos.clear();
@ -887,7 +893,10 @@ class DestinationController extends GetxController {
LatLng(currentLat, currentLon));
Destination des = festuretoDestination(fs);
if (distFs <= des.checkin_radious! && skipGps == false) {
if (distFs <= des.checkin_radious!
&& skipGps == false
//&& des.isCheckedIn == false
&& des.cp!=0 && des.cp!=-1 && des.cp!=-2) {
await startTimerLocation(fs, distFs);
// Note: You cannot break out of forEach. If you need to stop processing, you might have to reconsider using forEach.
}
@ -1015,7 +1024,15 @@ class DestinationController extends GetxController {
// print("~~~~ inserted into db ~~~~");
}
await _saveImageFromPath(imageurl);
if (imageurl == null || imageurl.isEmpty) {
if (photos.isNotEmpty) {
// imageurlが空の場合は、destinationのcheckin_imageプロパティを使用する
debugPrint("photos = ${photos}");
imageurl = photos[0].path;
}
debugPrint("imageurl = ${imageurl}");
await _saveImageFromPath(imageurl!);
}
populateDestinations();