Typeface.of constructor

Typeface.of(
  1. BuildContext context
)

Retrieve Typeface instance form context. If context has no instance of Typeface in it, Typeface.redmond is returned.

const typeface = Typeface.of(context)

Implementation

factory Typeface.of(BuildContext context) {
  //...
  final theme = Theme.of(context);
  final palette = Chrome.of(context);
  final x = PresetValue.of<Typeface>(context) ?? redmond;
  return x.copyWith(parent: theme.textTheme, palette: palette);
}