Skip to content

Add Theme-level option to align error text with the text field border (remove default indent/padding) #175834

@YawarOsman

Description

@YawarOsman

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:

InputDecorationTheme(
  errorPadding: EdgeInsets.zero, // or Alignment options
  errorAlignment: TextAlign.start,
)

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.

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.has partial patchThere is a PR awaiting someone to take it across the finish lineteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions