Best way to color text the secondary color of current theme? #3856
Labels
d: api docs
Issues with https://api.flutter.dev/
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
Projects
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]. UsingColors.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:This allows me to say
instead of
The text was updated successfully, but these errors were encountered: