From 8d7db30328a079b0988ceafe12443323e4294097 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Thu, 4 May 2023 16:17:00 -0600 Subject: [PATCH 1/2] move biometrics to appbar --- lib/pages/pinpad_views/lock_screen_view.dart | 49 +++++++++++--------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/lib/pages/pinpad_views/lock_screen_view.dart b/lib/pages/pinpad_views/lock_screen_view.dart index 316ef9b5d..a11dd4090 100644 --- a/lib/pages/pinpad_views/lock_screen_view.dart +++ b/lib/pages/pinpad_views/lock_screen_view.dart @@ -55,7 +55,6 @@ class LockscreenView extends ConsumerStatefulWidget { final VoidCallback? onSuccess; final String customKeyLabel; - @override ConsumerState createState() => _LockscreenViewState(); } @@ -223,31 +222,39 @@ class _LockscreenViewState extends ConsumerState { }, ) : Container(), + actions: [ + // check prefs and hide if user has biometrics toggle off? + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only( + right: 16.0, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + if (ref + .read(prefsChangeNotifierProvider) + .useBiometrics == + true) + CustomTextButton( + text: "Use biometrics", + onTap: () async { + await _checkUseBiometrics(); + }, + ), + ], + ), + ), + ], + ), + ], ), body: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - // check prefs and hide if user has biometrics toggle off? - Padding( - padding: const EdgeInsets.only(right: 40.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - if (ref.read(prefsChangeNotifierProvider).useBiometrics == - true) - CustomTextButton( - text: "Use biometrics", - onTap: () async { - await _checkUseBiometrics(); - }, - ), - ], - ), - ), - const SizedBox( - height: 55, - ), Shake( animationDuration: const Duration(milliseconds: 700), animationRange: 12, From 7c8b31dc4c7e5d7168d8c450d0a361470aa79ee2 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Thu, 4 May 2023 16:36:48 -0600 Subject: [PATCH 2/2] center lock screen PIN page --- lib/pages/pinpad_views/lock_screen_view.dart | 97 ++++++++++---------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/lib/pages/pinpad_views/lock_screen_view.dart b/lib/pages/pinpad_views/lock_screen_view.dart index a11dd4090..380717f72 100644 --- a/lib/pages/pinpad_views/lock_screen_view.dart +++ b/lib/pages/pinpad_views/lock_screen_view.dart @@ -204,55 +204,56 @@ class _LockscreenViewState extends ConsumerState { late Biometrics biometrics; Widget get _body => Background( - child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, - appBar: AppBar( - leading: widget.showBackButton - ? AppBarBackButton( - onPressed: () async { - if (FocusScope.of(context).hasFocus) { - FocusScope.of(context).unfocus(); - await Future.delayed( - const Duration(milliseconds: 70)); - } - if (mounted) { - Navigator.of(context).pop(); - } - }, - ) - : Container(), - actions: [ - // check prefs and hide if user has biometrics toggle off? - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.only( - right: 16.0, + child: SafeArea( + child: Scaffold( + extendBodyBehindAppBar: true, + backgroundColor: + Theme.of(context).extension()!.background, + appBar: AppBar( + leading: widget.showBackButton + ? AppBarBackButton( + onPressed: () async { + if (FocusScope.of(context).hasFocus) { + FocusScope.of(context).unfocus(); + await Future.delayed( + const Duration(milliseconds: 70)); + } + if (mounted) { + Navigator.of(context).pop(); + } + }, + ) + : Container(), + actions: [ + // check prefs and hide if user has biometrics toggle off? + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only( + right: 16.0, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + if (ref + .read(prefsChangeNotifierProvider) + .useBiometrics == + true) + CustomTextButton( + text: "Use biometrics", + onTap: () async { + await _checkUseBiometrics(); + }, + ), + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - if (ref - .read(prefsChangeNotifierProvider) - .useBiometrics == - true) - CustomTextButton( - text: "Use biometrics", - onTap: () async { - await _checkUseBiometrics(); - }, - ), - ], - ), - ), - ], - ), - ], - ), - body: SafeArea( - child: Column( + ], + ), + ], + ), + body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Shake(