getTextStyle method Null safety

TextStyle getTextStyle(
  1. {double textScaleFactor = 1.0}
)

The style information for text runs, encoded for use by dart:ui.

Implementation

ui.TextStyle getTextStyle({ double textScaleFactor = 1.0 }) {
  return ui.TextStyle(
    color: color,
    decoration: decoration,
    decorationColor: decorationColor,
    decorationStyle: decorationStyle,
    decorationThickness: decorationThickness,
    fontWeight: fontWeight,
    fontStyle: fontStyle,
    textBaseline: textBaseline,
    leadingDistribution: leadingDistribution,
    fontFamily: fontFamily,
    fontFamilyFallback: fontFamilyFallback,
    fontSize: fontSize == null ? null : fontSize! * textScaleFactor,
    letterSpacing: letterSpacing,
    wordSpacing: wordSpacing,
    height: height,
    locale: locale,
    foreground: foreground,
    background: background ?? (backgroundColor != null
      ? (Paint()..color = backgroundColor!)
      : null
    ),
    shadows: shadows,
    fontFeatures: fontFeatures,
    fontVariations: fontVariations,
  );
}