審査用に文言などを修正 ver.4.5.1 467

This commit is contained in:
2024-05-15 17:59:25 +09:00
parent dd9343bef7
commit df4405aedf
28 changed files with 843 additions and 227 deletions

View File

@ -39,7 +39,7 @@ class LocationController extends GetxController {
LatLng? lastValidLocation;
DateTime lastGPSDataReceivedTime = DateTime.now(); // 最後にGPSデータを受け取った時刻
bool gpsDebugMode = false;
bool gpsDebugMode = true;
/*
// GPSシミュレーション用のメソッドを追加
void setSimulationMode(bool value) {
@ -93,6 +93,10 @@ class LocationController extends GetxController {
// GPS信号の強弱を判断するメソッドを追加. 10m 以内強、30m以内中、それ以上
//
String getGpsSignalStrength(Position? position) {
if (isSimulationMode.value) {
return getSimulatedSignalStrength();
}
if (position == null) {
gpsDebugMode ? debugPrint("getGpsSignalStrength position is null.") : null;
latestSignalStrength.value = "low";
@ -110,7 +114,7 @@ class LocationController extends GetxController {
latestSignalStrength.value = "high";
isGpsSignalWeak = false;
return 'high';
} else if (accuracy <= 30) {
} else if (accuracy <= 50) {
latestSignalStrength.value = "medium";
isGpsSignalWeak = false;
return 'medium';
@ -189,9 +193,8 @@ class LocationController extends GetxController {
// Use GetX's context to show a dialog
Get.dialog(
AlertDialog(
title: const Text('Location Services Disabled'),
content: const Text(
'Please enable location services to continue using the app.'),
title: Text('location_services_disabled_title'.tr),
content: Text('location_services_disabled_title'.tr),
actions: <Widget>[
TextButton(
child: const Text('OK'),
@ -218,9 +221,8 @@ class LocationController extends GetxController {
// Show a dialog if permissions are still denied
Get.dialog(
AlertDialog(
title: const Text('Location Permission Denied'),
content: const Text(
'This app requires location permissions to function properly. Please enable location permissions in your device settings.'),
title: Text('location_permission_denied_title'.tr),
content: Text('location_permission_denied_main'.tr),
actions: <Widget>[
TextButton(
child: const Text('OK'),
@ -243,12 +245,11 @@ class LocationController extends GetxController {
// Show a dialog if permissions are permanently denied
Get.dialog(
AlertDialog(
title: const Text('Location Permission Needed'),
content: const Text(
'Location permissions have been permanently denied. Please open app settings to enable location permissions.'),
title: Text('location_permission_needed_title'.tr),
content: Text( 'location_permission_needed_main'.tr),
actions: <Widget>[
TextButton(
child: const Text('Open Settings'),
child: Text('open_settings'.tr),
onPressed: () {
// Close the dialog and open app settings
Get.back();
@ -412,4 +413,26 @@ class LocationController extends GetxController {
positionStream?.cancel();
super.onClose();
}
// シミュレーションモードのフラグ
RxBool isSimulationMode = RxBool(false);
// シミュレーションモードを切り替えるための関数
void setSimulationMode(bool value) {
isSimulationMode.value = value;
}
// GPS信号強度をシミュレートするための変数
final Rx<String> _simulatedSignalStrength = Rx<String>('high');
// GPS信号強度をシミュレートするための関数
void setSimulatedSignalStrength(String strength) {
_simulatedSignalStrength.value = strength;
}
// シミュレートされた信号強度を取得するための関数
String getSimulatedSignalStrength() {
return _simulatedSignalStrength.value;
}
}