Reland fix inputDecorator hint color on M3 (#150278)

## Description

This PR is a partial reland of https://github.com/flutter/flutter/pull/148944 which was reverted in https://github.com/flutter/flutter/pull/149448.
It makes the `InputDecoration.hintText` colors compliant with the M3 spec.
The initial PR also changed the font style, I will land the font change in another PR to better track the golden changes.

## Related Issue

Related to the color part of https://github.com/flutter/flutter/issues/148787.

## Tests

Updates several tests.
This commit is contained in:
Bruno Leroux
2024-06-25 23:42:59 +02:00
committed by GitHub
parent a37d9e05aa
commit 00419bfb24
4 changed files with 43 additions and 28 deletions

View File

@@ -34,9 +34,9 @@ class _${blockName}DefaultsM3 extends InputDecorationTheme {
@override
TextStyle? get hintStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return TextStyle(color: Theme.of(context).disabledColor);
return TextStyle(color: ${componentColor('md.comp.filled-text-field.disabled.supporting-text')});
}
return TextStyle(color: Theme.of(context).hintColor);
return TextStyle(color: ${componentColor('md.comp.filled-text-field.supporting-text')});
});
@override