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;
159
159
/// ```
160
160
/// {@endtemplate}
161
161
class SupaEmailAuth extends StatefulWidget {
162
+ /// Whether the email field should automatically focus when the form is shown
163
+ final bool autofocus;
164
+
162
165
/// The URL to redirect the user to when clicking on the link on the
163
166
/// confirmation link after signing up.
164
167
final String ? redirectTo;
@@ -220,6 +223,7 @@ class SupaEmailAuth extends StatefulWidget {
220
223
/// {@macro supa_email_auth}
221
224
const SupaEmailAuth ({
222
225
super .key,
226
+ this .autofocus = true ,
223
227
this .redirectTo,
224
228
this .resetPasswordRedirectTo,
225
229
this .passwordValidator,
@@ -298,7 +302,7 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
298
302
keyboardType: TextInputType .emailAddress,
299
303
autofillHints: const [AutofillHints .email],
300
304
autovalidateMode: AutovalidateMode .onUserInteraction,
301
- autofocus: true ,
305
+ autofocus: widget.autofocus ,
302
306
focusNode: _emailFocusNode,
303
307
textInputAction: _isRecoveringPassword
304
308
? TextInputAction .done
You can’t perform that action at this time.
0 commit comments