-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
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)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
d: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.