Fixed Location & Storage issues
This commit is contained in:
@ -14,6 +14,7 @@ import 'package:rogapp/main.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/model/gps_data.dart';
|
||||
import 'package:rogapp/pages/camera/camera_page.dart';
|
||||
import 'package:rogapp/pages/camera/custom_camera_view.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/DatabaseService.dart';
|
||||
@ -119,6 +120,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
var isCheckingIn = false.obs; // チェックイン操作中はtrueになり、重複してポップアップが出ないようにするもの。
|
||||
|
||||
var isRouteShowing = false.obs; // ルートが表示されているかどうかを示すReactive変数
|
||||
/*
|
||||
//==== Akira .. GPS信号シミュレーション用 ===== ここから、2024-4-5
|
||||
//
|
||||
@ -159,10 +161,18 @@ class DestinationController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//==== Akira .. GPS信号シミュレーション用 ======= ここまで
|
||||
*/
|
||||
|
||||
// ルートをクリアする関数です。
|
||||
void clearRoute() {
|
||||
indexController.routePoints.clear();
|
||||
indexController.routePointLenght.value = 0;
|
||||
isRouteShowing.value = false;
|
||||
}
|
||||
|
||||
void showGPSDataNotReceivedPopup() {
|
||||
if (Get.context != null) {
|
||||
Get.dialog(
|
||||
@ -750,6 +760,12 @@ class DestinationController extends GetxController {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => CustomCameraView(
|
||||
onImageCaptured: (imagePath) {
|
||||
photos.add(File(imagePath));
|
||||
},
|
||||
),
|
||||
/*
|
||||
builder: (_) => CameraCamera(
|
||||
resolutionPreset: ResolutionPreset.medium,
|
||||
onFile: (file) {
|
||||
@ -758,7 +774,10 @@ class DestinationController extends GetxController {
|
||||
//print("----image file is : $file----");
|
||||
//setState(() {});
|
||||
},
|
||||
)));
|
||||
)
|
||||
*/
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// ルートポイントを取得する関数です。
|
||||
@ -1075,6 +1094,12 @@ class DestinationController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> _saveImageToGallery(String imagePath) async {
|
||||
final status = await PermissionController.checkStoragePermission();
|
||||
if(!status){
|
||||
await PermissionController.requestStoragePermission();
|
||||
}
|
||||
|
||||
/*
|
||||
final status = await Permission.storage.status;
|
||||
if (!status.isGranted) {
|
||||
final result = await Permission.storage.request();
|
||||
@ -1105,9 +1130,11 @@ class DestinationController extends GetxController {
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
try {
|
||||
final result = await ImageGallerySaver.saveFile(imagePath);
|
||||
@ -1873,11 +1900,13 @@ class DestinationController extends GetxController {
|
||||
//Get.toNamed(AppPages.TRAVEL);
|
||||
});
|
||||
destinationCount.value = destinations.length;
|
||||
|
||||
} catch (_) {
|
||||
skipGps = false;
|
||||
return;
|
||||
} finally {
|
||||
//Get.back();
|
||||
isRouteShowing.value = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user