Fix InputDecorator default hint text style on M3 (#148944)
## Description This PRs makes the `InputDecoration.hintText` style compliant with the M3 spec. The hint style is not clearly specified in https://m3.material.io/components/text-fields/specs, but it is in the M3 Figma kit. ('hint' terminology came from the Material1 specification, since M2 the terminology is 'Placeholder'). See this Figma screenshot taken while focusing on the 'Placeholder' text (which corresponds to hint).  It seems that the intention is that the 'Placeholder' colors should be the same as the 'supporting text' ones, that is why is reused 'supporting text' tokens. ## Related Issue Fixes https://github.com/flutter/flutter/issues/148787. ## Tests Updates several tests.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user