applyFontWeightToFontVariationsWith method

TextTheme applyFontWeightToFontVariationsWith({
  1. String? fontFamily,
  2. Color? color,
})

Implementation

TextTheme applyFontWeightToFontVariationsWith({
  String? fontFamily,
  Color? color,
}) {
  return copyWith(
    displayLarge: displayLarge?.applyVariableWeight(),
    displayMedium: displayMedium?.applyVariableWeight(),
    displaySmall: displaySmall?.applyVariableWeight(),

    headlineLarge: headlineLarge?.applyVariableWeight(),
    headlineMedium: headlineMedium?.applyVariableWeight(),
    headlineSmall: headlineSmall?.applyVariableWeight(),

    titleLarge: titleLarge?.applyVariableWeight(),
    titleMedium: titleMedium?.applyVariableWeight(),
    titleSmall: titleSmall?.applyVariableWeight(),

    labelLarge: labelLarge?.applyVariableWeight(),
    labelMedium: labelMedium?.applyVariableWeight(),
    labelSmall: labelSmall?.applyVariableWeight(),

    bodyLarge: bodyLarge?.applyVariableWeight(),
    bodyMedium: bodyMedium?.applyVariableWeight(),
    bodySmall: bodySmall?.applyVariableWeight(),
  ).apply(
    fontFamily: fontFamily,
    displayColor: color,
    bodyColor: color,
  );
}