Skip to content

Commit 0917d0d

Browse files
authored
doc/improve-hint-text-doc (#156313)
This PR improve the Flutter documentation about the Textfield.hintText property. On our e-commerce app, Samsung pass was not working and we discovered that, after using hintText : Samsung pass autofill was working perfectly. Example (that can help) : ```dart TextFormField( autofillHints: const <String>[ // Order is important, username must be first AutofillHints.username, AutofillHints.email, ], keyboardType: TextInputType.emailAddress, decoration: InputDecoration( hintText: "What do you want, it doesn't matter but it's important to use it", ), ), ... TextFormField( autofillHints: const <String>[AutofillHints.password], obscureText: true, keyboardType: TextInputType.visiblePassword, decoration: InputDecoration( hintText: "What do you want, it doesn't matter but it's important to use it", ), ), ``` ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: Enguerrand ARMINJON WINDOWS <[email protected]>
1 parent 1e67f6c commit 0917d0d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/flutter/lib/src/widgets/editable_text.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,10 @@ class EditableText extends StatefulWidget {
18331833
/// Autofill service. Enable the autofill service of your choice, and make
18341834
/// sure there are available credentials associated with your app.
18351835
///
1836+
/// Specifying [InputDecoration.hintText] may also help autofill services
1837+
/// (like Samsung Pass) determine the expected content type of an input field,
1838+
/// although this is typically not required when autofillHints are present.
1839+
///
18361840
/// #### I called `TextInput.finishAutofillContext` but the autofill save
18371841
/// prompt isn't showing
18381842
///

0 commit comments

Comments
 (0)