From 9edd87b0afa330f2d3aecfcf3dad9a8bfcb0048c Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Wed, 25 Sep 2024 19:15:09 -0700 Subject: [PATCH] keep sign/verify pages loaded (#1703) --- lib/src/screens/dashboard/widgets/sign_form.dart | 6 +++++- lib/src/screens/dashboard/widgets/verify_form.dart | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/src/screens/dashboard/widgets/sign_form.dart b/lib/src/screens/dashboard/widgets/sign_form.dart index c0f8ba328..deead87a4 100644 --- a/lib/src/screens/dashboard/widgets/sign_form.dart +++ b/lib/src/screens/dashboard/widgets/sign_form.dart @@ -20,7 +20,7 @@ class SignForm extends StatefulWidget { SignFormState createState() => SignFormState(); } -class SignFormState extends State { +class SignFormState extends State with AutomaticKeepAliveClientMixin { SignFormState() : formKey = GlobalKey(), messageController = TextEditingController(), @@ -42,8 +42,12 @@ class SignFormState extends State { super.dispose(); } + @override + bool get wantKeepAlive => true; + @override Widget build(BuildContext context) { + super.build(context); return Container( padding: EdgeInsets.only(left: 24, right: 24), child: Column( diff --git a/lib/src/screens/dashboard/widgets/verify_form.dart b/lib/src/screens/dashboard/widgets/verify_form.dart index bf6809586..282ffa9da 100644 --- a/lib/src/screens/dashboard/widgets/verify_form.dart +++ b/lib/src/screens/dashboard/widgets/verify_form.dart @@ -15,7 +15,7 @@ class VerifyForm extends StatefulWidget { VerifyFormState createState() => VerifyFormState(); } -class VerifyFormState extends State { +class VerifyFormState extends State with AutomaticKeepAliveClientMixin { VerifyFormState() : formKey = GlobalKey(), messageController = TextEditingController(), @@ -36,9 +36,13 @@ class VerifyFormState extends State { void dispose() { super.dispose(); } + + @override + bool get wantKeepAlive => true; @override Widget build(BuildContext context) { + super.build(context); return Container( padding: EdgeInsets.only(left: 24, right: 24), child: Form(