getStyle method

TextStyle getStyle()

Implementation

TextStyle getStyle() {
  final effectiveFontSize = fontSize ?? style?.fontSize ?? 12.0;

  var baseStyle = style ?? const TextStyle();

  baseStyle = baseStyle.copyWith(
    fontFamily: coreKitInstance.fontFamily,
    fontSize: effectiveFontSize,
    fontWeight: fontWeight ?? baseStyle.fontWeight ?? FontWeight.w400,
    color: textColor ?? baseStyle.color,
    height: height ?? baseStyle.height,
    decoration: decoration ?? baseStyle.decoration,
    decorationColor: decorationColor ?? baseStyle.decorationColor,
  );

  final fontHeight = textHeight != null
      ? (textHeight! / effectiveFontSize)
      : baseStyle.height;

  return baseStyle.copyWith(height: fontHeight);
}