keep sign/verify pages loaded (#1703)

This commit is contained in:
Matthew Fosse 2024-09-25 19:15:09 -07:00 committed by GitHub
parent 647551661d
commit 9edd87b0af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -20,7 +20,7 @@ class SignForm extends StatefulWidget {
SignFormState createState() => SignFormState();
}
class SignFormState extends State<SignForm> {
class SignFormState extends State<SignForm> with AutomaticKeepAliveClientMixin {
SignFormState()
: formKey = GlobalKey<FormState>(),
messageController = TextEditingController(),
@ -42,8 +42,12 @@ class SignFormState extends State<SignForm> {
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(

View file

@ -15,7 +15,7 @@ class VerifyForm extends StatefulWidget {
VerifyFormState createState() => VerifyFormState();
}
class VerifyFormState extends State<VerifyForm> {
class VerifyFormState extends State<VerifyForm> with AutomaticKeepAliveClientMixin {
VerifyFormState()
: formKey = GlobalKey<FormState>(),
messageController = TextEditingController(),
@ -37,8 +37,12 @@ class VerifyFormState extends State<VerifyForm> {
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(