Skip to content

Commit e8a9204

Browse files
getkeydshukertjr
andauthored
Add autofill hints (#75)
* Add password autofill hint * Add some more autofill hints * formatted code --------- Co-authored-by: dshukertjr <dshukertjr@gmail.com>
1 parent 4ee3a81 commit e8a9204

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/src/components/supa_email_auth.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
152152
if (!_forgotPassword) ...[
153153
spacer(16),
154154
TextFormField(
155+
autofillHints: _isSigningIn
156+
? [AutofillHints.password]
157+
: [AutofillHints.newPassword],
155158
validator: (value) {
156159
if (value == null || value.isEmpty || value.length < 6) {
157160
return 'Please enter a password that is at least 6 characters long';

lib/src/components/supa_phone_auth.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class _SupaPhoneAuthState extends State<SupaPhoneAuth> {
5050
crossAxisAlignment: CrossAxisAlignment.stretch,
5151
children: [
5252
TextFormField(
53+
autofillHints: const [AutofillHints.telephoneNumber],
5354
validator: (value) {
5455
if (value == null || value.isEmpty) {
5556
return 'Please enter a valid phone number';
@@ -64,6 +65,9 @@ class _SupaPhoneAuthState extends State<SupaPhoneAuth> {
6465
),
6566
spacer(16),
6667
TextFormField(
68+
autofillHints: isSigningIn
69+
? [AutofillHints.password]
70+
: [AutofillHints.newPassword],
6771
validator: (value) {
6872
if (value == null || value.isEmpty || value.length < 6) {
6973
return 'Please enter a password that is at least 6 characters long';

lib/src/components/supa_reset_password.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class _SupaResetPasswordState extends State<SupaResetPassword> {
4242
crossAxisAlignment: CrossAxisAlignment.stretch,
4343
children: [
4444
TextFormField(
45+
autofillHints: const [AutofillHints.newPassword],
4546
validator: (value) {
4647
if (value == null || value.isEmpty || value.length < 6) {
4748
return 'Please enter a password that is at least 6 characters long';

0 commit comments

Comments
 (0)