TextStyle constructor
const
TextStyle({
- bool inherit = true,
- PdfColor? color,
- Font? font,
- Font? fontNormal,
- Font? fontBold,
- Font? fontItalic,
- Font? fontBoldItalic,
- List<
Font> fontFallback = const [], - double? fontSize,
- FontWeight? fontWeight,
- FontStyle? fontStyle,
- double? letterSpacing,
- double? wordSpacing,
- double? lineSpacing,
- double? height,
- BoxDecoration? background,
- TextDecoration? decoration,
- PdfColor? decorationColor,
- TextDecorationStyle? decorationStyle,
- double? decorationThickness,
- 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);