permission fix
parent
1c7730bf2e
commit
583b7b74e9
|
|
@ -70,7 +70,9 @@ class _LoginViewState extends State<LoginView> {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: _scaffoldKey,
|
key: _scaffoldKey,
|
||||||
backgroundColor: fillColor,
|
backgroundColor: fillColor,
|
||||||
body: Padding(
|
body: SingleChildScrollView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
|
@ -140,6 +142,7 @@ class _LoginViewState extends State<LoginView> {
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,15 +174,25 @@ class _SettingPrinterViewState extends State<SettingPrinterView> {
|
||||||
confirmationTitle: 'Хорошо',
|
confirmationTitle: 'Хорошо',
|
||||||
);
|
);
|
||||||
if (response.confirmed) {
|
if (response.confirmed) {
|
||||||
if (await Permission.locationAlways
|
|
||||||
.request()
|
PermissionStatus location = await Permission.location
|
||||||
.isGranted) {
|
.request();
|
||||||
|
|
||||||
|
if (location.isGranted ) {
|
||||||
|
PermissionStatus locationAlways = await Permission.locationAlways
|
||||||
|
.request();
|
||||||
|
if(locationAlways.isGranted) {
|
||||||
print('Granted');
|
print('Granted');
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(
|
_dialogService.showDialog(
|
||||||
description: 'Необходимо указать постоянный доступ к местоположении для поиска принтера');
|
description: 'Необходимо указать постоянный доступ к местоположении для поиска принтера');
|
||||||
_navigatorService.pop();
|
_navigatorService.pop();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_dialogService.showDialog(
|
||||||
|
description: 'Необходимо указать доступ к местоположении для поиска принтера');
|
||||||
|
_navigatorService.pop();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_navigatorService.pop();
|
_navigatorService.pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue