-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Add Theme-level option to align error text with the text field border (remove default indent/padding) #175834
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish lineteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish lineThere is a PR awaiting someone to take it across the finish lineteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Use case
Currently, when using
TextField / TextFormField, the error text (errorText) is rendered with an indent that matches the input/hint text padding. This behavior makes the error text look visually offset from the left border of the field.At the moment, the only way to fix this is by overriding decoration properties (error widget, custom padding, etc.) on each individual field. This is tedious and redundant in larger apps. If the padding needs to be adjusted later, developers must revisit every field manually.
Proposal
Introduce a theme-level property (e.g., in InputDecorationTheme) that controls the horizontal alignment/padding of error/helper text independently from the input/hint text.
Example API idea:
Why it matters:
Developers often want the input/hint text to be padded, but the error text to be flush with the text field border.
This improves visual consistency in UIs.
Reduces redundancy by eliminating per-field overrides.