diff --git a/lib/keyboard.dart b/lib/keyboard.dart index 3d4933f..6eda5a6 100644 --- a/lib/keyboard.dart +++ b/lib/keyboard.dart @@ -68,7 +68,7 @@ class Keyboard extends StatelessWidget { return Container( width: keyboardSize.width, height: keyboardSize.height, - margin: EdgeInsets.only(top: 16), + margin: EdgeInsets.only(top: 26), child: RawKeyboardListener( focusNode: _focusNode, autofocus: true, @@ -78,7 +78,8 @@ class Keyboard extends StatelessWidget { onKeyboardTap(event.logicalKey.keyLabel); return; } - if (event.logicalKey.keyLabel== 'Backspace' || event.logicalKey.keyLabel == 'Delete') { + if (event.logicalKey.keyLabel == 'Backspace' || + event.logicalKey.keyLabel == 'Delete') { onKeyboardTap(Keyboard.deleteButton); return; } diff --git a/lib/passcode_screen.dart b/lib/passcode_screen.dart index 41f51a9..d678a26 100644 --- a/lib/passcode_screen.dart +++ b/lib/passcode_screen.dart @@ -28,6 +28,7 @@ class PasscodeScreen extends StatefulWidget { final CancelCallback? cancelCallback; final Color? backgroundColor; + final AppBar? appBar; final Widget? bottomWidget; final List? digits; @@ -44,6 +45,7 @@ class PasscodeScreen extends StatefulWidget { KeyboardUIConfig? keyboardUIConfig, this.bottomWidget, this.backgroundColor, + this.appBar, this.cancelCallback, this.digits, }) : circleUIConfig = circleUIConfig ?? const CircleUIConfig(), @@ -89,6 +91,7 @@ class _PasscodeScreenState extends State @override Widget build(BuildContext context) { return Scaffold( + appBar: widget.appBar ?? null, backgroundColor: widget.backgroundColor ?? Colors.black.withOpacity(0.8), body: SafeArea( child: OrientationBuilder( @@ -263,7 +266,9 @@ class _PasscodeScreenState extends State _showValidation(bool isValid) { if (isValid) { - Navigator.maybePop(context).then((pop) => _validationCallback()); + if (Navigator.canPop(context)) { + Navigator.maybePop(context).then((pop) => _validationCallback()); + } } else { controller.forward(); }