feature(Lock-screen): Replaced login button with a floating action button (#103)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-11-02 08:43:42 +01:00 committed by GitHub
parent 76ac1aaa5b
commit 0761a50bfa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,16 +101,26 @@ class _LockScreenState extends ConsumerState<LockScreen> with WidgetsBindingObse
} }
}, },
child: Scaffold( child: Scaffold(
floatingActionButton: FloatingActionButton(
tooltip: context.localized.login,
onPressed: () {
ref.read(lockScreenActiveProvider.notifier).update((state) => false);
context.router.push(const LoginRoute());
},
child: const Icon(IconsaxOutline.arrow_swap_horizontal),
),
body: Center( body: Center(
child: Wrap( child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center, crossAxisAlignment: WrapCrossAlignment.center,
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
runAlignment: WrapAlignment.center, runAlignment: WrapAlignment.center,
direction: Axis.vertical,
children: [ children: [
const Icon( const Icon(
IconsaxOutline.lock_1, IconsaxOutline.lock_1,
size: 38, size: 38,
), ),
if (user != null)
ConstrainedBox( ConstrainedBox(
constraints: const BoxConstraints( constraints: const BoxConstraints(
maxHeight: 400, maxHeight: 400,
@ -119,19 +129,11 @@ class _LockScreenState extends ConsumerState<LockScreen> with WidgetsBindingObse
child: Padding( child: Padding(
padding: const EdgeInsets.all(64.0), padding: const EdgeInsets.all(64.0),
child: LoginIcon( child: LoginIcon(
user: user!, user: user,
onPressed: () => tapLoggedInAccount(user), onPressed: () => tapLoggedInAccount(user),
), ),
), ),
), ),
ElevatedButton.icon(
onPressed: () {
ref.read(lockScreenActiveProvider.notifier).update((state) => false);
context.router.push(const LoginRoute());
},
icon: const Icon(Icons.login_rounded),
label: Text(context.localized.login),
),
], ],
), ),
), ),