Material design has a concept of a secondary text color: https://www.google.com/design/spec/style/color.html#color-text-background-colors
I can access this color in flutter using the very verbose: Theme.of(context).textTheme.caption.color
. I don't want any of the extra styling (weight, fontSize) from from caption or display[1-4]. Using Colors.black54
directly is not ideal since it wouldn't adapt to theme changes. Is there a less verbose way for me to get the secondary text color of the current theme? Currently I made a package level function but it feels like there should be a better way:
Color secondary(BuildContext context) =>
Theme.of(context).textTheme.caption.color;
This allows me to say
new TextStyle(color: secondary(context))
instead of
new TextStyle(color: Theme.of(context).textTheme.caption.color)
@Hixie Sounds like ThemeData
should have a field for this.
Agreed.
The secondary color is the accent color. There's a field on ThemeData for the accent color; we should point to it from the TextStyle docs or some such.
Most helpful comment
@Hixie Sounds like
ThemeData
should have a field for this.