Skip to content

Commit

Permalink
Add autofill hints (#75)
Browse files Browse the repository at this point in the history
* Add password autofill hint

* Add some more autofill hints

* formatted code

---------

Co-authored-by: dshukertjr <[email protected]>
  • Loading branch information
getkey and dshukertjr authored Jan 29, 2024
1 parent 4ee3a81 commit e8a9204
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/components/supa_email_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
if (!_forgotPassword) ...[
spacer(16),
TextFormField(
autofillHints: _isSigningIn
? [AutofillHints.password]
: [AutofillHints.newPassword],
validator: (value) {
if (value == null || value.isEmpty || value.length < 6) {
return 'Please enter a password that is at least 6 characters long';
Expand Down
4 changes: 4 additions & 0 deletions lib/src/components/supa_phone_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class _SupaPhoneAuthState extends State<SupaPhoneAuth> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextFormField(
autofillHints: const [AutofillHints.telephoneNumber],
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter a valid phone number';
Expand All @@ -64,6 +65,9 @@ class _SupaPhoneAuthState extends State<SupaPhoneAuth> {
),
spacer(16),
TextFormField(
autofillHints: isSigningIn
? [AutofillHints.password]
: [AutofillHints.newPassword],
validator: (value) {
if (value == null || value.isEmpty || value.length < 6) {
return 'Please enter a password that is at least 6 characters long';
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/supa_reset_password.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class _SupaResetPasswordState extends State<SupaResetPassword> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextFormField(
autofillHints: const [AutofillHints.newPassword],
validator: (value) {
if (value == null || value.isEmpty || value.length < 6) {
return 'Please enter a password that is at least 6 characters long';
Expand Down

0 comments on commit e8a9204

Please sign in to comment.