20240903 pre release

This commit is contained in:
2024-09-03 22:17:09 +09:00
parent fe46d46ab6
commit 2c0bb06e74
44 changed files with 610 additions and 154 deletions

View File

@ -526,7 +526,7 @@ class DestinationController extends GetxController {
debugPrint("** 自動チェックインの場合");
//print(
// "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ make checkin ${d.sub_loc_id}@@@@@@@@@@@");
makeCheckin(d, true, ""); // チェックインして
makeCheckin(d, true, ""); // 自動チェックイン
//if (d.cp != -1 && d.cp != -2 && d.cp != 0 ) {
// rogainingCounted.value = true; // ゴール用チェックイン済み
//}
@ -750,9 +750,11 @@ class DestinationController extends GetxController {
}
int? latgoal = await db.latestGoal();
lastGoalAt = DateTime.fromMicrosecondsSinceEpoch(latgoal!);
debugPrint("===== last goal : $lastGoalAt =====");
if( latgoal != null ) {
lastGoalAt = DateTime.fromMicrosecondsSinceEpoch(latgoal!);
debugPrint("===== last goal : $lastGoalAt =====");
dbService.updateDatabase();
}
}
// すべての目的地を削除する関数です。
@ -835,7 +837,7 @@ class DestinationController extends GetxController {
print("---- f- checkin ${d.sub_loc_id} ----");
if (autoCheckin) {
if (!checkingIn) {
makeCheckin(d, true, "");
makeCheckin(d, true, ""); // callforCheckin
if (d.cp != -1 && d.cp != 0 && d.cp != -2) {
rogainingCounted.value = true;
}
@ -1085,12 +1087,13 @@ class DestinationController extends GetxController {
// ロゲイニングにデータを追加する関数です。
//
void addToRogaining(double lat, double lon, int destinationId) async {
debugPrint("addToRogaining .... ");
DatabaseHelper db = DatabaseHelper.instance;
List<Destination> d = await db.getDestinationById(destinationId);
if (d.isEmpty) {
Destination df = festuretoDestination(indexController.currentFeature[0]);
//print("--- made checkin ${df.location_id} ----");
makeCheckin(df, true, "");
makeCheckin(df, true, ""); // addToRogaining
}
isInRog.value = true;
@ -1138,10 +1141,10 @@ class DestinationController extends GetxController {
// ギャラリーにも保存
//await ImageGallerySaver.saveFile(savedImage.path);
await Future.delayed(const Duration(seconds: 3), () async {
await Future.delayed(const Duration(seconds: 5), () async {
final result = await ImageGallerySaver.saveFile(savedImage.path);
print("Save result: $result");
}).timeout(const Duration(seconds: 5));
}).timeout(const Duration(seconds: 7));
debugPrint('Image saved to: ${savedImage.path}');
@ -1214,14 +1217,16 @@ class DestinationController extends GetxController {
// print(
// "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ressssss ${destination.sub_loc_id}@@@@@@@@@@@");
DatabaseHelper db = DatabaseHelper.instance;
List<Destination> ddd =
await db.getDestinationByLatLon(destination.lat!, destination.lon!);
List<Destination> ddd = await db.getDestinationByLatLon(destination.lat!, destination.lon!);
if (ddd.isEmpty) {
destination.checkedin = true;
debugPrint("...近くにCPがないのにチェックイン...makeCheckin imageUrl = $imageurl");
if (imageurl.isNotEmpty) {
String? savedImagePath = await _saveImageToGallery(imageurl);
destination.checkin_image = savedImagePath ?? imageurl;
}else{
debugPrint("makeCheckin ... No image...");
}
await db.insertDestination(destination);
// print("~~~~ inserted into db ~~~~");
@ -1229,15 +1234,18 @@ class DestinationController extends GetxController {
if (imageurl.isEmpty) {
if (photos.isNotEmpty) {
debugPrint("imageurlが空の場合は、destinationのcheckin_imageプロパティを使用する");
// imageurlが空の場合は、destinationのcheckin_imageプロパティを使用する
debugPrint("photos = $photos");
imageurl = photos[0].path;
//debugPrint("photos = $photos");
//imageurl = photos[0].path;
}
debugPrint("imageurl = $imageurl");
//await _saveImageFromPath(imageurl!);
}
if (imageurl.isNotEmpty) {
debugPrint("...これでアルバム保存...makeCheckin imageUrl = $imageurl");
String? savedImagePath = await _saveImageToGallery(imageurl);
debugPrint("イメージのアルバム保存完了!!");
destination.checkin_image = savedImagePath ?? imageurl;
}