From 0917d0da6639e69bf5c71451515db1a9d3e14304 Mon Sep 17 00:00:00 2001 From: Enguerrand ARMINJON <37028599+EArminjon@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:49:58 +0100 Subject: [PATCH] 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 [ // 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 [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. [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 --- packages/flutter/lib/src/widgets/editable_text.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index 5c5e31d820..fa218d6dd5 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -1833,6 +1833,10 @@ class EditableText extends StatefulWidget { /// Autofill service. Enable the autofill service of your choice, and make /// sure there are available credentials associated with your app. /// + /// Specifying [InputDecoration.hintText] may also help autofill services + /// (like Samsung Pass) determine the expected content type of an input field, + /// although this is typically not required when autofillHints are present. + /// /// #### I called `TextInput.finishAutofillContext` but the autofill save /// prompt isn't showing ///