Normalize input decoration theme by bleroux · Pull Request #168981 · flutter/flutter

QuncCccccc

QuncCccccc

github-merge-queue bot pushed a commit that referenced this pull request

Jul 2, 2025
## Description

This PR adds tests for `InputDecorationThemeData.floatingLabelBehavior`,
`InputDecorationThemeData.floatingLabelAlignment`, and
`InputDecorationThemeData.contentPadding`.

## Related Issue

Related to #168981

## Tests

Adds 3 tests, moves one.

github-merge-queue bot pushed a commit that referenced this pull request

Jul 9, 2025
)

## Description

This PR is similar to what was done for `DatePickerThemeData` in
#168981.
It changes `TimePickerThemeData.inputDecorationTheme` type to
`InputDecorationThemeData` (instead of `InputDecorationTheme`) and uses
Object? for the corresponding constructor parameter.

## Tests

Adds 1 test

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 9, 2025
…ter#171584)

## Description

This PR is similar to what was done for `DatePickerThemeData` in
flutter#168981.
It changes `TimePickerThemeData.inputDecorationTheme` type to
`InputDecorationThemeData` (instead of `InputDecorationTheme`) and uses
Object? for the corresponding constructor parameter.

## Tests

Adds 1 test

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
This PR is to make `InputDecorationTheme` conform to Flutter Material's
conventions for component themes:

- Added a `InputDecorationThemeData` class which defines overrides for
the defaults for `InputDecorator` properties.
- Added `InputDecorationTheme` constructor parameters:
`InputDecorationThemeData? data` and `Widget? child`. This is now the
preferred way to configure a `InputDecorationTheme`:

```dart
InputDecorationTheme(
	data: InputDecorationThemeData(
	    filled: true,
	    fillColor: Colors.amber,
	    ...
	  ),
  	child: const TextField()
)
```
These two properties are made nullable to not break existing apps which
has customized `ThemeData.inputDecorationTheme`.

- Update `InputDecorationTheme` to be an `InheritedTheme` subclass.
- Changed the type of component theme defaults from
`InputDecorationTheme` to `InputDecorationThemeData`.
- Changed the `InputDecorationTheme bottomAppBarTheme` property to
`Object? bottomAppBarTheme` in `ThemeData` and `ThemeData.copyWith()`
(Object? is used for the moment to minimize Google tests failure. A
follow-up PR will replace `Object?` with `InputDecorationThemeData`.
- Addresses the "theme normalization" sub-project within flutter#91772.

A migration guide will be created on website repo.

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
…70905)

## Description

This PR fixes `InputDecoration.floatingLabelBehavior` logic to query
ambient InputDecorationTheme.floatingLabelBehavior, previously it was
ignored.

## Related Issue

Fixes [InputDecorationTheme and IconTheme isn't fully
inherited](flutter#71813)
Will help to complete flutter#168981

## Tests

Adds 1 test

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
…lutter#170905)" (flutter#170994)

<!-- start_original_pr_link -->
Reverts: flutter#170905
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: goderbauer
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Analyzer failure: `The argument type
'InputDecorationTheme' can't be assigned to the parameter type
'InputDecorationThemeData?'. •
packages/flutter/test/material/input_decorator_test.dart:2959:33 •
argument_type_not_assignable`
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bleroux
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {justinmc}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
## Description

This PR fixes `InputDecoration.floatingLabelBehavior` logic to query
ambient InputDecorationTheme.floatingLabelBehavior, previously it was
ignored.

## Related Issue

Fixes [InputDecorationTheme and IconTheme isn't fully
inherited](flutter#71813)
Will help to complete flutter#168981

## Tests

Adds 1 test
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
## Description

This PR adds missing M3 tests for `InputDecoration.isDense`.

## Related Issue

Related to flutter#168981

## Tests

Adds 4 tests.

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
…ter#170903)

## Description

This PR adds missing M3 tests for
InputDecoration.floatingLabelAlignment.

## Related Issue

Will help to complete flutter#168981

## Tests

Adds 8 tests (based on existing M2 tests).

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
)

## Description

This PR adds tests for `InputDecorationThemeData.floatingLabelBehavior`,
`InputDecorationThemeData.floatingLabelAlignment`, and
`InputDecorationThemeData.contentPadding`.

## Related Issue

Related to flutter#168981

## Tests

Adds 3 tests, moves one.

mboetger pushed a commit to mboetger/flutter that referenced this pull request

Jul 21, 2025
…ter#171584)

## Description

This PR is similar to what was done for `DatePickerThemeData` in
flutter#168981.
It changes `TimePickerThemeData.inputDecorationTheme` type to
`InputDecorationThemeData` (instead of `InputDecorationTheme`) and uses
Object? for the corresponding constructor parameter.

## Tests

Adds 1 test

azatech pushed a commit to azatech/flutter that referenced this pull request

Jul 28, 2025
…ter#171584)

## Description

This PR is similar to what was done for `DatePickerThemeData` in
flutter#168981.
It changes `TimePickerThemeData.inputDecorationTheme` type to
`InputDecorationThemeData` (instead of `InputDecorationTheme`) and uses
Object? for the corresponding constructor parameter.

## Tests

Adds 1 test

vashworth pushed a commit to vashworth/packages that referenced this pull request

Jul 30, 2025

ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request

Aug 19, 2025
…ter#171584)

## Description

This PR is similar to what was done for `DatePickerThemeData` in
flutter#168981.
It changes `TimePickerThemeData.inputDecorationTheme` type to
`InputDecorationThemeData` (instead of `InputDecorationTheme`) and uses
Object? for the corresponding constructor parameter.

## Tests

Adds 1 test

github-merge-queue bot pushed a commit that referenced this pull request

Sep 25, 2025
…175838)

## Description

This PR adds tests for `InputDecorationThemeData` border related
properties.
It also adds some missing M3 tests for those same properties.

## Related Issue

Related to #168981

## Tests

Adds 10 tests.

This was referenced

Sep 30, 2025

github-merge-queue bot pushed a commit that referenced this pull request

Oct 4, 2025
## 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

Fixes [TextFormField does not inherit local
InputDecorationTheme](#176391)

## Tests

- Adds 1 test

This was referenced

Oct 16, 2025