Skip to content

Fix TextFormField does not inherit local InputDecorationTheme - #176397

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
bleroux:Fix_TextFormField_does_not_inherit_local_InputDecorationTheme
Oct 4, 2025
Merged

Fix TextFormField does not inherit local InputDecorationTheme#176397
auto-submit[bot] merged 1 commit into
flutter:masterfrom
bleroux:Fix_TextFormField_does_not_inherit_local_InputDecorationTheme

Conversation

@bleroux

Copy link
Copy Markdown
Contributor

Description

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

Related Issue

FixesTextFormField does not inherit local InputDecorationTheme

Tests

  • Adds 1 test

@github-actionsgithub-actionsBot 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 d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Oct 2, 2025

@gemini-code-assistgemini-code-assistBot 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 fixes an issue where TextFormField did not inherit the local InputDecorationTheme. The change replaces the usage of the global ThemeData.inputDecorationTheme with InputDecorationTheme.of(context) to correctly resolve the ambient theme. The changes include updating the TextFormField implementation, its documentation, an example file to demonstrate the correct usage, and adding a new regression test.

Comment threadpackages/flutter/test/material/text_form_field_test.dart
@bleroux
blerouxforce-pushed the Fix_TextFormField_does_not_inherit_local_InputDecorationTheme branch from 3d25417 to fdfbd97CompareOctober 2, 2025 13:11
@bleroux
bleroux requested a review from justinmcOctober 3, 2025 18:29

@justinmcjustinmc 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.

LGTM 👍 . Good catch! Thanks for reporting and fixing this.

@blerouxbleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 4, 2025
@auto-submit
auto-submitBot added this pull request to the merge queueOct 4, 2025
Merged via the queue into flutter:master with commit 067d793Oct 4, 2025
78 checks passed
@flutter-dashboardflutter-dashboardBot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 4, 2025
@bleroux
bleroux deleted the Fix_TextFormField_does_not_inherit_local_InputDecorationTheme branch October 4, 2025 07:40
auto-submitBot pushed a commit to flutter/packages that referenced this pull request Oct 6, 2025
flutter/flutter@5c0c9e9...908012d
2025-10-05 engine-flutter-autoroll@skia.org Roll Skia from 5479115ef5bf to 1fd0ca1f2120 (1 revision) (flutter/flutter#176541)
2025-10-05 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from oWcBvgdpdlGvaqiDg... to Zm6K_3gP3VCaMy9rH... (flutter/flutter#176538)
2025-10-05 engine-flutter-autoroll@skia.org Roll Dart SDK from 53aeaeb2454c to 016a8c0045fd (1 revision) (flutter/flutter#176531)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from f316de3d47b4 to 5479115ef5bf (4 revisions) (flutter/flutter#176529)
2025-10-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 9bc52df78b67 to 53aeaeb2454c (1 revision) (flutter/flutter#176525)
2025-10-04 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from HUhTcRn-LUXa2Salu... to oWcBvgdpdlGvaqiDg... (flutter/flutter#176515)
2025-10-04 bruno.leroux@gmail.com Fix TextFormField does not inherit local InputDecorationTheme (flutter/flutter#176397)
2025-10-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 0009748aed50 to 9bc52df78b67 (4 revisions) (flutter/flutter#176506)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from 9cda1a2050c4 to f316de3d47b4 (2 revisions) (flutter/flutter#176504)
2025-10-04 codefu@google.com fix: support older git (ubuntu 22.04) in content hash (flutter/flutter#176321)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from a454242c3934 to 9cda1a2050c4 (2 revisions) (flutter/flutter#176499)
2025-10-03 59215665+davidhicks980@users.noreply.github.com [material/menu_anchor.dart] Check for reserved padding updates on layout delegate. (flutter/flutter#176457)
2025-10-03 engine-flutter-autoroll@skia.org Roll Skia from b842026480e0 to a454242c3934 (3 revisions) (flutter/flutter#176484)
2025-10-03 30870216+gaaclarke@users.noreply.github.com Starts updating the DEPS in preupload. (flutter/flutter#176485)
2025-10-03 aam@google.com Align flutter dependencies with ones coming from dart. (flutter/flutter#176475)
2025-10-03 codefu@google.com fix: delay exiting microbenchmark (flutter/flutter#176477)
2025-10-03 15619084+vashworth@users.noreply.github.com Add state restoration for UIScene migration (flutter/flutter#176305)
2025-10-03 louisehsu@google.com Fix Voiceover traversal for OutlinedButton.icon (flutter/flutter#175810)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Oct 7, 2025
…r#176397)
## Description
This PR replaces global `ThemeData.inputDecorationTheme` usage in
`TextFormField` with `InputDecorationTheme.of ` which returns the
ambient `InputDecorationTheme`.
It is a follow up to flutter#168981
which introduces `InputDecorationTheme.of `.
## Related Issue
Fixes [TextFormField does not inherit local
InputDecorationTheme](flutter#176391)
## Tests
- Adds 1 test
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Oct 7, 2025
…r#176397)
## Description
This PR replaces global `ThemeData.inputDecorationTheme` usage in
`TextFormField` with `InputDecorationTheme.of ` which returns the
ambient `InputDecorationTheme`.
It is a follow up to flutter#168981
which introduces `InputDecorationTheme.of `.
## Related Issue
Fixes [TextFormField does not inherit local
InputDecorationTheme](flutter#176391)
## Tests
- Adds 1 test
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…r#176397)
## Description
This PR replaces global `ThemeData.inputDecorationTheme` usage in
`TextFormField` with `InputDecorationTheme.of ` which returns the
ambient `InputDecorationTheme`.
It is a follow up to flutter#168981
which introduces `InputDecorationTheme.of `.
## Related Issue
Fixes [TextFormField does not inherit local
InputDecorationTheme](flutter#176391)
## Tests
- Adds 1 test
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@5c0c9e9...908012d
2025-10-05 engine-flutter-autoroll@skia.org Roll Skia from 5479115ef5bf to 1fd0ca1f2120 (1 revision) (flutter/flutter#176541)
2025-10-05 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from oWcBvgdpdlGvaqiDg... to Zm6K_3gP3VCaMy9rH... (flutter/flutter#176538)
2025-10-05 engine-flutter-autoroll@skia.org Roll Dart SDK from 53aeaeb2454c to 016a8c0045fd (1 revision) (flutter/flutter#176531)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from f316de3d47b4 to 5479115ef5bf (4 revisions) (flutter/flutter#176529)
2025-10-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 9bc52df78b67 to 53aeaeb2454c (1 revision) (flutter/flutter#176525)
2025-10-04 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from HUhTcRn-LUXa2Salu... to oWcBvgdpdlGvaqiDg... (flutter/flutter#176515)
2025-10-04 bruno.leroux@gmail.com Fix TextFormField does not inherit local InputDecorationTheme (flutter/flutter#176397)
2025-10-04 engine-flutter-autoroll@skia.org Roll Dart SDK from 0009748aed50 to 9bc52df78b67 (4 revisions) (flutter/flutter#176506)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from 9cda1a2050c4 to f316de3d47b4 (2 revisions) (flutter/flutter#176504)
2025-10-04 codefu@google.com fix: support older git (ubuntu 22.04) in content hash (flutter/flutter#176321)
2025-10-04 engine-flutter-autoroll@skia.org Roll Skia from a454242c3934 to 9cda1a2050c4 (2 revisions) (flutter/flutter#176499)
2025-10-03 59215665+davidhicks980@users.noreply.github.com [material/menu_anchor.dart] Check for reserved padding updates on layout delegate. (flutter/flutter#176457)
2025-10-03 engine-flutter-autoroll@skia.org Roll Skia from b842026480e0 to a454242c3934 (3 revisions) (flutter/flutter#176484)
2025-10-03 30870216+gaaclarke@users.noreply.github.com Starts updating the DEPS in preupload. (flutter/flutter#176485)
2025-10-03 aam@google.com Align flutter dependencies with ones coming from dart. (flutter/flutter#176475)
2025-10-03 codefu@google.com fix: delay exiting microbenchmark (flutter/flutter#176477)
2025-10-03 15619084+vashworth@users.noreply.github.com Add state restoration for UIScene migration (flutter/flutter#176305)
2025-10-03 louisehsu@google.com Fix Voiceover traversal for OutlinedButton.icon (flutter/flutter#175810)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text inputEntering text in a text field or keyboard related problemsd: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextFormField does not inherit local InputDecorationTheme

2 participants

@bleroux@justinmc