Merge pull request #519 from cypherstack/ui-fixes

fix biometrics button + center PIN page
This commit is contained in:
Diego Salazar 2023-05-04 16:56:03 -06:00 committed by GitHub
commit 63fa856b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,6 @@ class LockscreenView extends ConsumerStatefulWidget {
final VoidCallback? onSuccess;
final String customKeyLabel;
@override
ConsumerState<LockscreenView> createState() => _LockscreenViewState();
}
@ -205,49 +204,58 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
late Biometrics biometrics;
Widget get _body => Background(
child: Scaffold(
backgroundColor:
Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: widget.showBackButton
? AppBarBackButton(
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
FocusScope.of(context).unfocus();
await Future<void>.delayed(
const Duration(milliseconds: 70));
}
if (mounted) {
Navigator.of(context).pop();
}
},
)
: Container(),
),
body: SafeArea(
child: Column(
child: SafeArea(
child: Scaffold(
extendBodyBehindAppBar: true,
backgroundColor:
Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
leading: widget.showBackButton
? AppBarBackButton(
onPressed: () async {
if (FocusScope.of(context).hasFocus) {
FocusScope.of(context).unfocus();
await Future<void>.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();
},
),
],
),
),
],
),
],
),
body: 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,