location problem android permissions
parent
9bb4c47249
commit
40efff3fb7
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<network-security-config>
|
<network-security-config>
|
||||||
<!--Set application-wide security config using base-config tag.-->
|
<!--Set application-wide security config using base-config tag.-->
|
||||||
<base-config cleartextTrafficPermitted="true"/>
|
<base-config cleartextTrafficPermitted="false"/>
|
||||||
</network-security-config>
|
</network-security-config>
|
||||||
|
|
@ -79,6 +79,7 @@ class _LoginViewState extends State<LoginView> {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
verticalSpaceLarge,
|
||||||
Stack(
|
Stack(
|
||||||
alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
|
||||||
|
|
@ -164,12 +164,21 @@ class _SettingPrinterViewState extends State<SettingPrinterView> {
|
||||||
//только для Android
|
//только для Android
|
||||||
void _permission() async {
|
void _permission() async {
|
||||||
if( Platform.isAndroid) {
|
if( Platform.isAndroid) {
|
||||||
var status = await Permission.locationAlways.status;
|
var statusLocation = await Permission.location.status;
|
||||||
log.i(status);
|
var statusLocationAlways = await Permission.locationAlways.status;
|
||||||
if (status.isUndetermined || status.isDenied || status.isPermanentlyDenied) {
|
log.i(statusLocation);
|
||||||
|
log.i(statusLocationAlways);
|
||||||
|
if (
|
||||||
|
statusLocation.isUndetermined
|
||||||
|
|| statusLocation.isDenied
|
||||||
|
|| statusLocation.isPermanentlyDenied
|
||||||
|
|| statusLocationAlways.isUndetermined
|
||||||
|
|| statusLocationAlways.isDenied
|
||||||
|
|| statusLocationAlways.isPermanentlyDenied
|
||||||
|
) {
|
||||||
DialogResponse response = await _dialogService.showConfirmationDialog(
|
DialogResponse response = await _dialogService.showConfirmationDialog(
|
||||||
title: 'Доступ',
|
title: 'Доступ',
|
||||||
description: 'Для поиска устройств Bluetooth необходимо предоставить доступ к отслеживанию геолокации.',
|
description: 'Для поиска устройств Bluetooth необходимо предоставить доступ к собиру данных о местоположении, даже когда приложение закрыто или не используется.',
|
||||||
cancelTitle: 'Нет',
|
cancelTitle: 'Нет',
|
||||||
confirmationTitle: 'Хорошо',
|
confirmationTitle: 'Хорошо',
|
||||||
);
|
);
|
||||||
|
|
@ -185,15 +194,16 @@ class _SettingPrinterViewState extends State<SettingPrinterView> {
|
||||||
print('Granted');
|
print('Granted');
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(
|
_dialogService.showDialog(
|
||||||
description: 'Необходимо указать постоянный доступ к местоположении для поиска принтера');
|
description: 'Необходимо предоставить постоянный доступ к местоположении для поиска принтера, даже когда приложение закрыто или не используется.');
|
||||||
_navigatorService.pop();
|
_navigatorService.pop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(
|
_dialogService.showDialog(
|
||||||
description: 'Необходимо указать доступ к местоположении для поиска принтера');
|
description: 'Необходимо предоставить доступ к местоположении для поиска принтера, даже когда приложение закрыто или не используется.');
|
||||||
_navigatorService.pop();
|
_navigatorService.pop();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
_navigatorService.pop();
|
_navigatorService.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: aman_kassa_flutter
|
name: aman_kassa_flutter
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
version: 1.2.3+30
|
version: 1.2.3+32
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.3.0 <3.0.0'
|
sdk: '>=2.3.0 <3.0.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue