Skip to content

Fix TextField does not inherit local InputDecorationTheme - #176300

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bleroux:fix_TextField_does_not_inherit_local_InputDecorationTheme
Oct 9, 2025
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
bleroux:fix_TextField_does_not_inherit_local_InputDecorationTheme

Conversation

@bleroux

@bleroux bleroux commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Description

This PR replaces global ThemeData.inputDecorationTheme usage in TextField with InputDecorationTheme.of which returns the ambient InputDecorationTheme.
It is a follow up to #168981 which introduces InputDecorationTheme.of .

Related Issue

Fixes [SearchBar] Inconsistent inheritance of InputDecorationTheme

Tests

  • Adds 1 test
  • Updates 1 test

@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Sep 30, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly updates TextField to use the ambient InputDecorationTheme, allowing for local theme overrides. The change is well-tested, with updates to an existing test and the addition of a new one to cover the new behavior. I've suggested a minor improvement to the new test to enhance readability and robustness by making an implicit dependency explicit.

Comment thread packages/flutter/test/material/text_field_test.dart
@bleroux
bleroux force-pushed the fix_TextField_does_not_inherit_local_InputDecorationTheme branch from bf90ea0 to e1c84fb Compare September 30, 2025 19:34
@bleroux
bleroux requested a review from QuncCccccc September 30, 2025 19:36
@bleroux
bleroux force-pushed the fix_TextField_does_not_inherit_local_InputDecorationTheme branch from e1c84fb to 4eac95c Compare October 1, 2025 06:20
@dkwingsmt
dkwingsmt self-requested a review October 1, 2025 18:09
@QuncCccccc
QuncCccccc force-pushed the fix_TextField_does_not_inherit_local_InputDecorationTheme branch from 4eac95c to fe7cf56 Compare October 7, 2025 15:31
@Piinks Piinks mentioned this pull request Oct 7, 2025
1 of 4 tasks

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement. LGTM! Thank you!

Comment thread packages/flutter/lib/src/material/text_field.dart Outdated
@bleroux
bleroux force-pushed the fix_TextField_does_not_inherit_local_InputDecorationTheme branch from fe7cf56 to 37fa353 Compare October 8, 2025 06:01
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 9, 2025
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 9, 2025
Merged via the queue into flutter:master with commit 1275194 Oct 9, 2025
79 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 9, 2025
@bleroux
bleroux deleted the fix_TextField_does_not_inherit_local_InputDecorationTheme branch October 9, 2025 08:35
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 15, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…6300)

## Description

This PR replaces global `ThemeData.inputDecorationTheme` usage in
`TextField` with `InputDecorationTheme.of ` which returns the ambient
`InputDecorationTheme`.
It is a follow up to flutter#168981
which introduces `InputDecorationTheme.of `.

## Related Issue

Fixes [[SearchBar] Inconsistent inheritance of
InputDecorationTheme](flutter#176198)

## Tests

- Adds 1 test
- Updates 1 test
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SearchBar] Inconsistent inheritance of InputDecorationTheme

2 participants