blendTextTheme property
- @Deprecated('The `blendTextTheme` is deprecated, it no longer has any ' 'function and will be removed in v9. More info below.\n' '\n' 'The `blendTextTheme` feature was originally ' "made before Material-3's TextTheme was available, before it was fully " 'known how it was going to be implemented. It was an approximation of ' 'the TextStyles that could be seen in early versions of Material-3 ' 'images. Since the actual Material-3 TextTheme is available, the tinted ' 'TextTheme feature is no longer needed. While the FCS tinted TextTheme ' 'did provide an alternative version of the actual tint used in ' 'Material-3, but the differences were quite subtle. Additionally, ' 'recent changes in Flutter make using it very verbose and complicated. ' 'Why it does so, is explained below.\n' '\n' 'In Material-3 Typography 2021, the TextTheme and all styles in it are ' 'fully opaque and use onSurface as color on all TextStyles. ' 'In a seed generated ColorScheme, the text becomes primary tinted, ' 'because the onSurface color by default has subtle primary tint. ' 'With FCS you can modify the onSurface to black or white to avoid this, ' 'if so preferred.\n' '\n' 'In Material-2 Typography 2018 and 2014, some TextStyles ' 'in their TextThemes use partially transparent white or ' 'black colors, making them appear tinted ' 'when placed on lightly colored backgrounds. Such TextStyles also ' 'have lower contrast. If the Material-3 default text theme is ' 'used on background colors that are tinted with a color that ' 'deviates a lot in hue from the hue used as tint color by the TextTheme, ' 'it may not fit it so well. The Material-2 opacity-based text styles ' 'do not have this limitation. It is unknown why Material-3 switched to ' 'a fixed tint color instead of using the opacity-based approach ' 'used in Material-2, that is more universally ' 'usable on backgrounds with different tint colors.\n' '\n' 'In Material-3, some component themes override the default color the of ' 'the default TextTheme TextStyles they use with onSurfaceVariant. ' 'This color has slightly more tint and lower contrast than onSurface. ' 'This is used for elements that should have less emphasis. Many default ' 'Material-3 components also override the color in default TextTheme ' 'TextStyles ' 'they use with onSurface color, that it actually already has in a ' 'default TextTheme. These two overrides causes whatever ' 'color the default TextTheme TextStyles have, to be overridden by ' 'these ColorScheme colors. Resulting in that any custom colored ' 'TextTheme is not getting used by such Material-3 components and that ' 'the custom colors from the meticulously colored custom TextTheme, ' 'are rarely visible anywhere in a Material-3 application. Material-2 ' 'component themes do not do this, nor did older Flutter versions of ' 'Material-3 component themes do this.\n' '\n' 'An issue has been raised explaining the challenges this newer approach ' 'in Flutter causes when using custom colored text themes. If this ' 'issue is addressed, the tinted TextTheme feature in FCS may ' 'be brought back, if it is a requested feature.\n' '\n' 'In current Flutter versions, using a custom tinted TextTheme is ' 'rather pointless. You can do it, but is not enough to just define the ' 'TextTheme. You also have to pass each tinted TextStyle it has to the ' 'appropriate TextStyles in ALL component themes that override its ' 'colors, for it to have any effect. It is typically not ' 'worth the effort.\n')
Use selection surfaceMode and blendLevel in FlexColorScheme.light
and FlexColorScheme.dark to also blend primary color into text themes
for both ThemeData.textTheme and ThemeData.primaryTextTheme.
This feature is similar to the slightly colored texts seen in Material 3 when using "onColor" colored texts.
This feature does not work so well if you need to put text on a completely different colored container than the background color. Which is why this feature can be opted out of.
M3 has separate on colors for all colorscheme colors that can also be used for color matched text on each color. However, this slightly primary colored default text works very well for the slight primary colored M3 "neutral" surface colors with a primary hint too.
At heavy blend levels it may reduce contrast too much and can be turned off if so desired. This feature is a bit experimental in nature and will be improved over time. Expect minor changes to the visual result when using this option in future versions when actual Material 3 text theme Typography becomes available.
Defaults to false.
Style break info: In FCS before version 7, the default was true, and blended text themes were used by default. Going forward if you want it, and also if you had not defined earlier and don't want to break your apps past style, set blendTextTheme to true.
Implementation
@Deprecated(
'The `blendTextTheme` is deprecated, it no longer has any '
'function and will be removed in v9. More info below.\n'
'\n'
'The `blendTextTheme` feature was originally '
"made before Material-3's TextTheme was available, before it was fully "
'known how it was going to be implemented. It was an approximation of '
'the TextStyles that could be seen in early versions of Material-3 '
'images. Since the actual Material-3 TextTheme is available, the tinted '
'TextTheme feature is no longer needed. While the FCS tinted TextTheme '
'did provide an alternative version of the actual tint used in '
'Material-3, but the differences were quite subtle. Additionally, '
'recent changes in Flutter make using it very verbose and complicated. '
'Why it does so, is explained below.\n'
'\n'
'In Material-3 Typography 2021, the TextTheme and all styles in it are '
'fully opaque and use onSurface as color on all TextStyles. '
'In a seed generated ColorScheme, the text becomes primary tinted, '
'because the onSurface color by default has subtle primary tint. '
'With FCS you can modify the onSurface to black or white to avoid this, '
'if so preferred.\n'
'\n'
'In Material-2 Typography 2018 and 2014, some TextStyles '
'in their TextThemes use partially transparent white or '
'black colors, making them appear tinted '
'when placed on lightly colored backgrounds. Such TextStyles also '
'have lower contrast. If the Material-3 default text theme is '
'used on background colors that are tinted with a color that '
'deviates a lot in hue from the hue used as tint color by the TextTheme, '
'it may not fit it so well. The Material-2 opacity-based text styles '
'do not have this limitation. It is unknown why Material-3 switched to '
'a fixed tint color instead of using the opacity-based approach '
'used in Material-2, that is more universally '
'usable on backgrounds with different tint colors.\n'
'\n'
'In Material-3, some component themes override the default color the of '
'the default TextTheme TextStyles they use with onSurfaceVariant. '
'This color has slightly more tint and lower contrast than onSurface. '
'This is used for elements that should have less emphasis. Many default '
'Material-3 components also override the color in default TextTheme '
'TextStyles '
'they use with onSurface color, that it actually already has in a '
'default TextTheme. These two overrides causes whatever '
'color the default TextTheme TextStyles have, to be overridden by '
'these ColorScheme colors. Resulting in that any custom colored '
'TextTheme is not getting used by such Material-3 components and that '
'the custom colors from the meticulously colored custom TextTheme, '
'are rarely visible anywhere in a Material-3 application. Material-2 '
'component themes do not do this, nor did older Flutter versions of '
'Material-3 component themes do this.\n'
'\n'
'An issue has been raised explaining the challenges this newer approach '
'in Flutter causes when using custom colored text themes. If this '
'issue is addressed, the tinted TextTheme feature in FCS may '
'be brought back, if it is a requested feature.\n'
'\n'
'In current Flutter versions, using a custom tinted TextTheme is '
'rather pointless. You can do it, but is not enough to just define the '
'TextTheme. You also have to pass each tinted TextStyle it has to the '
'appropriate TextStyles in ALL component themes that override its '
'colors, for it to have any effect. It is typically not '
'worth the effort.\n',
)
final bool blendTextTheme;