permission fix

backend_nfc
error500 2021-08-31 13:31:23 +06:00
parent 1c7730bf2e
commit 583b7b74e9
2 changed files with 81 additions and 68 deletions

View File

@ -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> {
) )
], ],
), ),
),
)); ));
}); });
} }

View File

@ -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();
} }