toTextTheme method

TextTheme toTextTheme(
  1. ColorScheme colorScheme
)

Converts the brand typography into a Material Design TextTheme

Automatically applies appropriate colors from the provided color scheme while maintaining the brand's typographic hierarchy and font family.

colorScheme - The color scheme to apply to the text styles Returns a complete TextTheme configured with brand typography and colors

Implementation

TextTheme toTextTheme(ColorScheme colorScheme) => TextTheme(
  bodyLarge: bodyLarge.copyWith(
    color: colorScheme.onSurface,
    fontFamily: fontFamily,
  ),
  bodyMedium: bodyMedium.copyWith(
    color: colorScheme.onSurface.withValues(alpha: 0.8),
    fontFamily: fontFamily,
  ),
  bodySmall: bodySmall.copyWith(
    color: colorScheme.onSurface.withValues(alpha: 0.6),
    fontFamily: fontFamily,
  ),
  displayLarge: displayLarge.copyWith(
    color: colorScheme.onSurface,
    fontFamily: fontFamily,
  ),
  displayMedium: displayMedium.copyWith(
    color: colorScheme.onSurface,
    fontFamily: fontFamily,
  ),
  labelLarge: labelLarge.copyWith(
    color: colorScheme.onPrimary,
    fontFamily: fontFamily,
  ),
  labelMedium: labelMedium.copyWith(
    color: colorScheme.onPrimary.withValues(alpha: 0.8),
    fontFamily: fontFamily,
  ),
  labelSmall: labelSmall.copyWith(
    color: colorScheme.onPrimary.withValues(alpha: 0.8),
    fontFamily: fontFamily,
  ),
  titleLarge: titleLarge.copyWith(
    color: colorScheme.primary,
    fontFamily: fontFamily,
  ),
  titleMedium: titleMedium.copyWith(
    color: colorScheme.onSurface,
    fontFamily: fontFamily,
  ),
  titleSmall: titleSmall.copyWith(
    color: colorScheme.onSurface.withValues(alpha: 0.8),
    fontFamily: fontFamily,
  ),
);