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