Android release 4.8.2 revision 483
This commit is contained in:
@ -3,7 +3,7 @@ import 'dart:io';
|
||||
//import 'dart:convert';
|
||||
//import 'dart:developer';
|
||||
import 'package:rogapp/model/gps_data.dart';
|
||||
import 'package:rogapp/pages/home/home_page.dart';
|
||||
//import 'package:rogapp/pages/home/home_page.dart';
|
||||
import 'package:rogapp/utils/database_gps.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
@ -141,6 +141,7 @@ void main() async {
|
||||
// startMemoryMonitoring(); // 2024-4-8 Akira: メモリ使用量のチェックを開始 See #2810
|
||||
Get.put(SettingsController()); // これを追加
|
||||
|
||||
|
||||
/*
|
||||
runZonedGuarded(() {
|
||||
runApp(const ProviderScope(child: MyApp()));
|
||||
@ -149,6 +150,8 @@ void main() async {
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
|
||||
runApp(const ProviderScope(child: MyApp()));
|
||||
//runApp(HomePage()); // MyApp()からHomePage()に変更
|
||||
//runApp(const MyApp());
|
||||
@ -324,7 +327,7 @@ Future<void> addGPStoDB(double la, double ln) async {
|
||||
is_checkin: 0,
|
||||
created_at: DateTime.now().millisecondsSinceEpoch);
|
||||
var res = await db.insertGps(gps_data);
|
||||
//debugPrint("バックグラウンドでのGPS保存:");
|
||||
debugPrint("バックグラウンドでのGPS保存:");
|
||||
} catch (err) {
|
||||
print("errr ready gps ${err}");
|
||||
return;
|
||||
@ -367,52 +370,39 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
}
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
// Add to clear
|
||||
// ウィジェットが構築された後に権限をチェック
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showLocationDisclosure(context);
|
||||
PermissionController.checkAndRequestPermissions();
|
||||
});
|
||||
|
||||
/*
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
await PermissionController.checkAndRequestPermissions();
|
||||
});
|
||||
*/
|
||||
|
||||
debugPrint("Start MyAppState...");
|
||||
}
|
||||
|
||||
void showLocationDisclosure(BuildContext context) {
|
||||
/*
|
||||
void showPermissionRequiredDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text('位置情報の使用について'),
|
||||
content: const SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text('このアプリでは、以下の目的で位置情報を使用します:'),
|
||||
Text('• チェックポイントの自動チェックイン(アプリが閉じているときも含む)'),
|
||||
Text('• 移動履歴の記録(バックグラウンドでも継続)'),
|
||||
Text('• 現在地周辺の情報表示'),
|
||||
Text('\nバックグラウンドでも位置情報を継続的に取得します。'),
|
||||
Text('これにより、バッテリーの消費が増加する可能性があります。'),
|
||||
],
|
||||
),
|
||||
),
|
||||
title: Text('権限が必要です'),
|
||||
content: Text('このアプリは機能するために位置情報の権限が必要です。設定で権限を許可してください。'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('同意しない'),
|
||||
child: Text('設定を開く'),
|
||||
onPressed: () {
|
||||
openAppSettings();
|
||||
Navigator.of(context).pop();
|
||||
// アプリを終了するなどの処理
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('同意する'),
|
||||
child: Text('アプリを終了'),
|
||||
onPressed: () {
|
||||
// アプリを終了
|
||||
Navigator.of(context).pop();
|
||||
requestLocationPermission();
|
||||
// よりクリーンな終了のために 'flutter_exit_app' のようなプラグインを使用することをお勧めします
|
||||
// 今回は単にすべてのルートをポップします
|
||||
Navigator.of(context).popUntil((route) => false);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -421,6 +411,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
|
||||
Reference in New Issue
Block a user