Return function instead of wrapping in annoymous callback

This commit is contained in:
istalri 2026-06-05 20:55:51 +02:00
commit 9ea6cd07a7

View file

@ -60,7 +60,7 @@ class LoginPage extends HookConsumerWidget {
appBar: Appbar( appBar: Appbar(
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back), icon: Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(), onPressed: Navigator.of(context).pop,
), ),
), ),
body: AlertDialog( body: AlertDialog(
@ -125,7 +125,7 @@ class LoginPage extends HookConsumerWidget {
), ),
actions: [ actions: [
TextButton( TextButton(
onPressed: hasError.value ? null : () => tryLogin(), onPressed: hasError.value ? null : tryLogin,
child: Text("Sign In"), child: Text("Sign In"),
), ),
], ],