diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 18bc715..e771add 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,15 +9,10 @@ FlutterApplication and put your custom class here. --> - - - - - - + - - { //только для Android void _permission() async { if( Platform.isAndroid) { - var statusLocation = await Permission.location.status; - //var statusLocationAlways = await Permission.locationAlways.status; - log.i(statusLocation); - //log.i(statusLocationAlways); - if ( - statusLocation.isUndetermined - || statusLocation.isDenied - || statusLocation.isPermanentlyDenied - // || statusLocationAlways.isUndetermined - // || statusLocationAlways.isDenied - // || statusLocationAlways.isPermanentlyDenied - ) { + var status = await Permission.location.status; + log.i(status); + if (status.isUndetermined || status.isDenied || status.isPermanentlyDenied) { DialogResponse response = await _dialogService.showConfirmationDialog( title: 'Доступ', - description: 'Для поиска устройств Bluetooth необходимо предоставить доступ к собиру данных о местоположении.', + description: 'Для поиска устройств Bluetooth необходимо предоставить доступ к отслеживанию геолокации.', cancelTitle: 'Нет', confirmationTitle: 'Хорошо', ); if (response.confirmed) { - - PermissionStatus location = await Permission.location - .request(); - - if (location.isGranted ) { - // PermissionStatus locationAlways = await Permission.locationAlways - // .request(); - // if(locationAlways.isGranted) { - // print('Granted'); - // } else { - // _dialogService.showDialog( - // description: 'Необходимо предоставить постоянный доступ к местоположении для поиска принтера, даже когда приложение закрыто или не используется.'); - // _navigatorService.pop(); - // } + if (await Permission.location + .request() + .isGranted) { + print('Granted'); } else { _dialogService.showDialog( - description: 'Необходимо предоставить доступ к местоположении для поиска принтера'); + description: 'Необходимо указать постоянный доступ к местоположении для поиска принтера'); _navigatorService.pop(); } } else { diff --git a/pubspec.lock b/pubspec.lock index cd9d5bf..1188dda 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -428,7 +428,7 @@ packages: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.2" plugin_platform_interface: dependency: transitive description: @@ -442,7 +442,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.2.3" protobuf: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 86c442b..294bdc8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: aman_kassa_flutter description: A new Flutter project. -version: 1.2.3+34 +version: 1.2.3+36 environment: sdk: '>=2.3.0 <3.0.0' dependencies: