[material_ui] Add supportingTextPadding to InputDecorator - #12769
[material_ui] Add supportingTextPadding to InputDecorator#12769MohanadAbdallah-mv wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the supportingTextPadding property to InputDecorator, InputDecoration, InputDecorationTheme, and InputDecorationThemeData to allow custom padding for the supporting text row, while renaming internal 'subtext' references to 'supportingText'. Feedback on these changes highlights that InputDecorationThemeData.lerp is missing interpolation for the new supportingTextPadding property, which is necessary for smooth theme transitions, and suggests adding a corresponding test case to verify this behavior.
| border: border ?? other.border, | ||
| constraints: constraints ?? other.constraints, | ||
| visualDensity: visualDensity ?? other.visualDensity, | ||
| supportingTextPadding: supportingTextPadding ?? other.supportingTextPadding, | ||
| ); |
There was a problem hiding this comment.
The InputDecorationThemeData.lerp method is missing the interpolation for supportingTextPadding. Without this, transitions between different input decoration themes will not animate the supporting text padding smoothly.
Please update InputDecorationThemeData.lerp to include:
supportingTextPadding: EdgeInsetsGeometry.lerp(a?.supportingTextPadding, b?.supportingTextPadding, t),| testWidgets('supportingTextPadding defined in InputDecorationTheme is used for supporting text', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| const themePaddingStart = 40.0; | ||
| const themePaddingEnd = 20.0; |
|
@dkwingsmt @Renzo-Olivares |
This PR introduces the
supportingTextPaddingproperty toInputDecorator,InputDecoration, andInputDecorationThemeData.While originally conceived as
errorPadding, this property was renamed tosupportingTextPaddingduring 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:
supportingTextPadding: Allows complete, independent control over the padding of the supporting text row (helper/error/counter).supportingTextConstraintsin_layout()to bound the supporting text row independently ofcontentConstraints, ensuring custom paddings do not break or shift the layout of inlineprefix/suffixwidgets.computeMinIntrinsicHeight()to computesupportingTextWidthseparately from the primary width deflation path, ensuring intrinsic height calculations accurately predict wrapped text heights.subtextreferences (e.g._SubtextSize,_computeSubtextSizes,subtextHeight) tosupportingTextto match the public property name and the M3 spec.List which issues are fixed by this PR. You must list at least one issue.
Port of #183582 which Fixes #175834
Pre-Review Checklist
[shared_preferences]///).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. Comments from the
gemini-code-assistbot 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.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2