Docs: Update docs for suffix icon interaction behaviour (#169828)

Docs: Update docs for suffix icon interaction behaviour
fixes: #167713 

## 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.
This commit is contained in:
Kishan Rathore 2025-06-12 00:19:40 +05:30 committed by GitHub
parent b9a99683ae
commit e765ed43a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -603,6 +603,27 @@ class TextField extends StatefulWidget {
///
/// If non-null this property overrides the [decoration]'s
/// [InputDecoration.enabled] property.
///
/// When a text field is disabled, all of its children widgets are also
/// disabled, including the [InputDecoration.suffixIcon]. If you need to keep
/// the suffix icon interactive while disabling the text field, consider using
/// [readOnly] and [enableInteractiveSelection] instead:
///
/// ```dart
/// TextField(
/// enabled: true,
/// readOnly: true,
/// enableInteractiveSelection: false,
/// decoration: InputDecoration(
/// suffixIcon: IconButton(
/// onPressed: () {
/// // This will work because the TextField is enabled
/// },
/// icon: const Icon(Icons.edit_outlined),
/// ),
/// ),
/// )
/// ```
final bool? enabled;
/// Determines whether this widget ignores pointer events.