materialTextTheme static method

TextTheme materialTextTheme(
  1. Color ink,
  2. Color ink2
)

Full Material TextTheme populated with the roles above. Pass an ink color so heavy roles default to it.

Implementation

static TextTheme materialTextTheme(Color ink, Color ink2) {
  TextStyle base(TextStyle s) => s.copyWith(color: ink);
  TextStyle secondary(TextStyle s) => s.copyWith(color: ink2);
  return TextTheme(
    displayLarge: base(displayXl),
    displayMedium: base(display),
    displaySmall: base(displaySm),
    headlineLarge: base(h1),
    headlineMedium: base(h2),
    headlineSmall: base(h3),
    titleLarge: base(title.copyWith(fontSize: 17)),
    titleMedium: base(title),
    titleSmall: base(titleSm),
    bodyLarge: secondary(body.copyWith(fontSize: 16)),
    bodyMedium: secondary(body),
    bodySmall: secondary(bodySm),
    labelLarge: base(title.copyWith(letterSpacing: 0.3)),
    labelMedium: base(titleSm.copyWith(letterSpacing: 0.4)),
    labelSmall: base(label),
  );
}