threadTypographyCodeTextStyle function

TextStyle threadTypographyCodeTextStyle(
  1. BuildContext context, {
  2. TextStyle? textStyle,
  3. Color? color,
  4. Color? backgroundColor,
  5. double? fontSize,
  6. FontWeight? fontWeight,
  7. FontStyle? fontStyle,
  8. double? letterSpacing,
  9. double? wordSpacing,
  10. TextBaseline? textBaseline,
  11. double? height,
  12. Locale? locale,
  13. Paint? foreground,
  14. Paint? background,
  15. List<Shadow>? shadows,
  16. List<FontFeature>? fontFeatures,
  17. TextDecoration? decoration,
  18. Color? decorationColor,
  19. TextDecorationStyle? decorationStyle,
  20. double? decorationThickness,
  21. TextOverflow? overflow,
  22. bool inherit = true,
})

Implementation

TextStyle threadTypographyCodeTextStyle(
  BuildContext context, {
  TextStyle? textStyle,
  Color? color,
  Color? backgroundColor,
  double? fontSize,
  FontWeight? fontWeight,
  FontStyle? fontStyle,
  double? letterSpacing,
  double? wordSpacing,
  TextBaseline? textBaseline,
  double? height,
  Locale? locale,
  Paint? foreground,
  Paint? background,
  List<Shadow>? shadows,
  List<FontFeature>? fontFeatures,
  TextDecoration? decoration,
  Color? decorationColor,
  TextDecorationStyle? decorationStyle,
  double? decorationThickness,
  TextOverflow? overflow,
  bool inherit = true,
}) {
  final fontFamily = ThreadTypographyOverride.maybeCodeFontFamilyOf(context);
  if (fontFamily != null && fontFamily.isNotEmpty) {
    return _plainTextStyleWithFontFamily(
      textStyle ?? TextStyle(inherit: inherit),
      fontFamily: fontFamily,
      color: color,
      backgroundColor: backgroundColor,
      fontSize: fontSize,
      fontWeight: fontWeight,
      fontStyle: fontStyle,
      letterSpacing: letterSpacing,
      wordSpacing: wordSpacing,
      textBaseline: textBaseline,
      height: height,
      locale: locale,
      foreground: foreground,
      background: background,
      shadows: shadows,
      fontFeatures: fontFeatures,
      decoration: decoration,
      decorationColor: decorationColor,
      decorationStyle: decorationStyle,
      decorationThickness: decorationThickness,
      overflow: overflow,
      inherit: inherit,
    );
  }

  return GoogleFonts.sourceCodePro(
    textStyle: textStyle,
    color: color,
    backgroundColor: backgroundColor,
    fontSize: fontSize,
    fontWeight: fontWeight,
    fontStyle: fontStyle,
    letterSpacing: letterSpacing,
    wordSpacing: wordSpacing,
    textBaseline: textBaseline,
    height: height,
    locale: locale,
    foreground: foreground,
    background: background,
    shadows: shadows,
    fontFeatures: fontFeatures,
    decoration: decoration,
    decorationColor: decorationColor,
    decorationStyle: decorationStyle,
    decorationThickness: decorationThickness,
  ).copyWith(overflow: overflow, inherit: inherit);
}