TextStyle constructor

const TextStyle({
  1. bool inherit = true,
  2. PdfColor? color,
  3. Font? font,
  4. Font? fontNormal,
  5. Font? fontBold,
  6. Font? fontItalic,
  7. Font? fontBoldItalic,
  8. List<Font> fontFallback = const [],
  9. double? fontSize,
  10. FontWeight? fontWeight,
  11. FontStyle? fontStyle,
  12. double? letterSpacing,
  13. double? wordSpacing,
  14. double? lineSpacing,
  15. double? height,
  16. BoxDecoration? background,
  17. TextDecoration? decoration,
  18. PdfColor? decorationColor,
  19. TextDecorationStyle? decorationStyle,
  20. double? decorationThickness,
  21. PdfTextRenderingMode? renderingMode,
})

Implementation

const TextStyle({
  this.inherit = true,
  this.color,
  Font? font,
  Font? fontNormal,
  Font? fontBold,
  Font? fontItalic,
  Font? fontBoldItalic,
  this.fontFallback = const [],
  this.fontSize,
  this.fontWeight,
  this.fontStyle,
  this.letterSpacing,
  this.wordSpacing,
  this.lineSpacing,
  this.height,
  this.background,
  this.decoration,
  this.decorationColor,
  this.decorationStyle,
  this.decorationThickness,
  this.renderingMode,
})  : assert(inherit || color != null),
      assert(inherit || fontNormal != null),
      assert(inherit || fontBold != null),
      assert(inherit || fontItalic != null),
      assert(inherit || fontBoldItalic != null),
      assert(inherit || fontSize != null),
      assert(inherit || fontWeight != null),
      assert(inherit || fontStyle != null),
      assert(inherit || letterSpacing != null),
      assert(inherit || wordSpacing != null),
      assert(inherit || lineSpacing != null),
      assert(inherit || height != null),
      assert(inherit || decoration != null),
      assert(inherit || decorationStyle != null),
      assert(inherit || decorationThickness != null),
      assert(inherit || renderingMode != null),
      fontNormal = fontNormal ??
          (fontStyle != FontStyle.italic && fontWeight != FontWeight.bold
              ? font
              : null),
      fontBold = fontBold ??
          (fontStyle != FontStyle.italic && fontWeight == FontWeight.bold
              ? font
              : null),
      fontItalic = fontItalic ??
          (fontStyle == FontStyle.italic && fontWeight != FontWeight.bold
              ? font
              : null),
      fontBoldItalic = fontBoldItalic ??
          (fontStyle == FontStyle.italic && fontWeight == FontWeight.bold
              ? font
              : null);