Skip to content

Commit fb6c86b

Browse files
MohanadAbdallah-mvdkwingsmt
authored andcommitted
Rename "subtext" to "supportingTextPadding" in FormField's documentation (flutter#183582)
**Maintainer's note:** This PR was originally named "Adding supportingTextPadding to InputDecorator and InputDecorationTheme", and has been split into two parts due to decoupling. The majority of the change is now applied by flutter/packages#12769 . This PR only addresses the terminology change, since we discovered that the M3 spec (https://m3.material.io/components/text-fields/specs ) officially refers to error text and hint text as "supporting text". ----- This PR introduces the `supportingTextPadding` property to `InputDecorator`, `InputDecoration`, and `InputDecorationThemeData`. While originally conceived as `errorPadding`, this property was renamed to `supportingTextPadding` during review to align with the Material Design 3 specification, as it controls the padding for the entire supporting text row (which includes helper text, error text, and counter widgets). Additionally, this PR addresses layout, intrinsic sizing, and code consistency concerns raised during the review process: #### Key Features & Refactors: 1. **Added `supportingTextPadding`:** Allows complete, independent control over the padding of the supporting text row (helper/error/counter). 2. **Decoupled Layout Constraints:** Introduced `supportingTextConstraints` in `_layout()` to bound the supporting text row independently of `contentConstraints`, ensuring custom paddings do not break or shift the layout of inline `prefix`/`suffix` widgets. 3. **Fixed Intrinsic Height Mismatches:** Corrected `computeMinIntrinsicHeight()` to compute `supportingTextWidth` separately from the primary width deflation path, ensuring intrinsic height calculations accurately predict wrapped text heights. 4. **Unified Terminology:** Renamed all legacy internal `subtext` references (e.g. `_SubtextSize`, `_computeSubtextSizes`, `subtextHeight`) to `supportingText` to match the public property name and the M3 spec. *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* Fixes flutter#175834 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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: Tong Mu <[email protected]>
1 parent f3b74d5 commit fb6c86b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/flutter/lib/src/widgets/form.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ class FormField<T> extends StatefulWidget {
569569
/// value.
570570
///
571571
/// Alternating between error and normal state can cause the height of the
572-
/// [TextFormField] to change if no other subtext decoration is set on the
572+
/// [TextFormField] to change if no other supporting text decoration is set on the
573573
/// field. To create a field whose height is fixed regardless of whether or
574574
/// not an error is displayed, either wrap the [TextFormField] in a fixed
575575
/// height parent like [SizedBox], or set the [InputDecoration.helperText]

0 commit comments

Comments
 (0)