mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
parent
c4d40cc152
commit
9367641ce2
@ -137,23 +137,23 @@ class _${blockName}DefaultsM3 extends InputDecorationTheme {
|
||||
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.label-text")} ?? const TextStyle();
|
||||
if(states.contains(MaterialState.error)) {
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.focus.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.hover.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.label-text')});
|
||||
}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.focus.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.hover.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.disabled.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.label-text')});
|
||||
}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.label-text')});
|
||||
});
|
||||
|
||||
@override
|
||||
@ -161,50 +161,50 @@ class _${blockName}DefaultsM3 extends InputDecorationTheme {
|
||||
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.label-text")} ?? const TextStyle();
|
||||
if(states.contains(MaterialState.error)) {
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.focus.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.hover.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.label-text')});
|
||||
}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.focus.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.hover.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.label-text')});
|
||||
}
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.disabled.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.label-text')});
|
||||
}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.label-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.label-text')});
|
||||
});
|
||||
|
||||
@override
|
||||
TextStyle? get helperStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
|
||||
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.supporting-text")} ?? const TextStyle();${componentColor('md.comp.filled-text-field.focus.supporting-text') == componentColor('md.comp.filled-text-field.supporting-text') ? '' : '''
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.focus.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.focus.supporting-text')});
|
||||
}'''}${componentColor('md.comp.filled-text-field.hover.supporting-text') == componentColor('md.comp.filled-text-field.supporting-text') ? '' : '''
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.hover.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.hover.supporting-text')});
|
||||
}'''}
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.disabled.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.disabled.supporting-text')});
|
||||
}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.supporting-text')});
|
||||
});
|
||||
|
||||
@override
|
||||
TextStyle? get errorStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
|
||||
final TextStyle textStyle = ${textStyle("md.comp.filled-text-field.supporting-text")} ?? const TextStyle();${componentColor('md.comp.filled-text-field.error.focus.supporting-text') == componentColor('md.comp.filled-text-field.error.supporting-text') ? '' : '''
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.focus.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.focus.supporting-text')});
|
||||
}'''}${componentColor('md.comp.filled-text-field.error.hover.supporting-text') == componentColor('md.comp.filled-text-field.error.supporting-text') ? '' : '''
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.hover.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.hover.supporting-text')});
|
||||
}'''}
|
||||
return textStyle.copyWith(color:${componentColor('md.comp.filled-text-field.error.supporting-text')});
|
||||
return textStyle.copyWith(color: ${componentColor('md.comp.filled-text-field.error.supporting-text')});
|
||||
});
|
||||
}
|
||||
''';
|
||||
|
||||
@ -4645,23 +4645,23 @@ class _InputDecoratorDefaultsM3 extends InputDecorationTheme {
|
||||
final TextStyle textStyle = _textTheme.bodyLarge ?? const TextStyle();
|
||||
if(states.contains(MaterialState.error)) {
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:_colors.error);
|
||||
return textStyle.copyWith(color: _colors.error);
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:_colors.onErrorContainer);
|
||||
return textStyle.copyWith(color: _colors.onErrorContainer);
|
||||
}
|
||||
return textStyle.copyWith(color:_colors.error);
|
||||
return textStyle.copyWith(color: _colors.error);
|
||||
}
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:_colors.primary);
|
||||
return textStyle.copyWith(color: _colors.primary);
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:_colors.onSurfaceVariant);
|
||||
return textStyle.copyWith(color: _colors.onSurfaceVariant);
|
||||
}
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:_colors.onSurface.withOpacity(0.38));
|
||||
return textStyle.copyWith(color: _colors.onSurface.withOpacity(0.38));
|
||||
}
|
||||
return textStyle.copyWith(color:_colors.onSurfaceVariant);
|
||||
return textStyle.copyWith(color: _colors.onSurfaceVariant);
|
||||
});
|
||||
|
||||
@override
|
||||
@ -4669,38 +4669,38 @@ class _InputDecoratorDefaultsM3 extends InputDecorationTheme {
|
||||
final TextStyle textStyle = _textTheme.bodyLarge ?? const TextStyle();
|
||||
if(states.contains(MaterialState.error)) {
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:_colors.error);
|
||||
return textStyle.copyWith(color: _colors.error);
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:_colors.onErrorContainer);
|
||||
return textStyle.copyWith(color: _colors.onErrorContainer);
|
||||
}
|
||||
return textStyle.copyWith(color:_colors.error);
|
||||
return textStyle.copyWith(color: _colors.error);
|
||||
}
|
||||
if (states.contains(MaterialState.focused)) {
|
||||
return textStyle.copyWith(color:_colors.primary);
|
||||
return textStyle.copyWith(color: _colors.primary);
|
||||
}
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return textStyle.copyWith(color:_colors.onSurfaceVariant);
|
||||
return textStyle.copyWith(color: _colors.onSurfaceVariant);
|
||||
}
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:_colors.onSurface.withOpacity(0.38));
|
||||
return textStyle.copyWith(color: _colors.onSurface.withOpacity(0.38));
|
||||
}
|
||||
return textStyle.copyWith(color:_colors.onSurfaceVariant);
|
||||
return textStyle.copyWith(color: _colors.onSurfaceVariant);
|
||||
});
|
||||
|
||||
@override
|
||||
TextStyle? get helperStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
|
||||
final TextStyle textStyle = _textTheme.bodySmall ?? const TextStyle();
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return textStyle.copyWith(color:_colors.onSurface.withOpacity(0.38));
|
||||
return textStyle.copyWith(color: _colors.onSurface.withOpacity(0.38));
|
||||
}
|
||||
return textStyle.copyWith(color:_colors.onSurfaceVariant);
|
||||
return textStyle.copyWith(color: _colors.onSurfaceVariant);
|
||||
});
|
||||
|
||||
@override
|
||||
TextStyle? get errorStyle => MaterialStateTextStyle.resolveWith((Set<MaterialState> states) {
|
||||
final TextStyle textStyle = _textTheme.bodySmall ?? const TextStyle();
|
||||
return textStyle.copyWith(color:_colors.error);
|
||||
return textStyle.copyWith(color: _colors.error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user