diff --git a/lib/views/login/login_view.dart b/lib/views/login/login_view.dart index e6b122d..a6c646f 100644 --- a/lib/views/login/login_view.dart +++ b/lib/views/login/login_view.dart @@ -70,75 +70,78 @@ class _LoginViewState extends State { return Scaffold( key: _scaffoldKey, backgroundColor: fillColor, - body: Padding( - padding: const EdgeInsets.symmetric(horizontal: 50), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Stack( - alignment: Alignment.bottomLeft, - children: [ - SizedBox( - height: 150, - child: Image.asset('assets/images/logo.png'), - ), - Positioned( - child: Text( - 'онлайн касса', - style: TextStyle(fontWeight: FontWeight.bold), + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 50), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Stack( + alignment: Alignment.bottomLeft, + children: [ + SizedBox( + height: 150, + child: Image.asset('assets/images/logo.png'), ), - bottom: 23.0, - left: 25.0, - ), - ], - ), + Positioned( + child: Text( + 'онлайн касса', + style: TextStyle(fontWeight: FontWeight.bold), + ), + bottom: 23.0, + left: 25.0, + ), + ], + ), - InputField( - placeholder: 'Электронная почта', - controller: emailController, - textInputType: TextInputType.emailAddress, - nextFocusNode: passwordNode, - additionalNote: vm.loginFormMessage.email, - ), - verticalSpaceSmall, - InputField( - placeholder: 'Пароль', - password: true, - controller: passwordController, - fieldFocusNode: passwordNode, - additionalNote: vm.loginFormMessage.password, - enterPressed: _pressBtnEnter, - textInputAction: TextInputAction.done, - ), - verticalSpaceMedium, - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox( - width: 150, - child: BusyButton( - title: 'Войти', - busy: vm.isLoading, - onPressed: _pressBtnEnter, - ), - ) - ], - ), - verticalSpaceLarge, + InputField( + placeholder: 'Электронная почта', + controller: emailController, + textInputType: TextInputType.emailAddress, + nextFocusNode: passwordNode, + additionalNote: vm.loginFormMessage.email, + ), + verticalSpaceSmall, + InputField( + placeholder: 'Пароль', + password: true, + controller: passwordController, + fieldFocusNode: passwordNode, + additionalNote: vm.loginFormMessage.password, + enterPressed: _pressBtnEnter, + textInputAction: TextInputAction.done, + ), + verticalSpaceMedium, + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox( + width: 150, + child: BusyButton( + title: 'Войти', + busy: vm.isLoading, + onPressed: _pressBtnEnter, + ), + ) + ], + ), + verticalSpaceLarge, // TextLink( // 'Регистрация', // onPressed: () {}, // ), - IconButton( - icon: Icon(MdiIcons.qrcodeScan), - iconSize: 40, - tooltip: "Scan", - onPressed: scan, - ) - ], + IconButton( + icon: Icon(MdiIcons.qrcodeScan), + iconSize: 40, + tooltip: "Scan", + onPressed: scan, + ) + ], + ), ), )); }); diff --git a/lib/views/settings/setting_printer_view.dart b/lib/views/settings/setting_printer_view.dart index a94b72f..c724b03 100644 --- a/lib/views/settings/setting_printer_view.dart +++ b/lib/views/settings/setting_printer_view.dart @@ -174,13 +174,23 @@ class _SettingPrinterViewState extends State { confirmationTitle: 'Хорошо', ); if (response.confirmed) { - if (await Permission.locationAlways - .request() - .isGranted) { - print('Granted'); + + 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: 'Необходимо указать постоянный доступ к местоположении для поиска принтера'); + description: 'Необходимо указать доступ к местоположении для поиска принтера'); _navigatorService.pop(); } } else {