File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ typedef MetadataController = Object;
159159/// ```
160160/// {@endtemplate}
161161class SupaEmailAuth extends StatefulWidget {
162+ /// Whether the email field should automatically focus when the form is shown
163+ final bool autofocus;
164+
162165 /// The URL to redirect the user to when clicking on the link on the
163166 /// confirmation link after signing up.
164167 final String ? redirectTo;
@@ -220,6 +223,7 @@ class SupaEmailAuth extends StatefulWidget {
220223 /// {@macro supa_email_auth}
221224 const SupaEmailAuth ({
222225 super .key,
226+ this .autofocus = true ,
223227 this .redirectTo,
224228 this .resetPasswordRedirectTo,
225229 this .passwordValidator,
@@ -298,7 +302,7 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
298302 keyboardType: TextInputType .emailAddress,
299303 autofillHints: const [AutofillHints .email],
300304 autovalidateMode: AutovalidateMode .onUserInteraction,
301- autofocus: true ,
305+ autofocus: widget.autofocus ,
302306 focusNode: _emailFocusNode,
303307 textInputAction: _isRecoveringPassword
304308 ? TextInputAction .done
You can’t perform that action at this time.
0 commit comments