getTextSize static method

double getTextSize(
  1. BuildContext context, {
  2. UpStyle? override,
  3. UpStyle? style,
  4. UpColorType? colorType,
  5. UpTextType? textType,
})

Implementation

static double getTextSize(
  BuildContext context, {
  UpStyle? override,
  UpStyle? style,
  UpColorType? colorType,
  UpTextType? textType,
}) {
  switch (textType) {
    case UpTextType.heading1:
      return override?.heading1Size ??
          style?.heading1Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading1Size ??
          UpConstants.kDefaultStyleHeading1Size;
    case UpTextType.heading2:
      return override?.heading2Size ??
          style?.heading2Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading2Size ??
          UpConstants.kDefaultStyleHeading2Size;
    case UpTextType.heading3:
      return override?.heading3Size ??
          style?.heading3Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading3Size ??
          UpConstants.kDefaultStyleHeading3Size;
    case UpTextType.heading4:
      return override?.heading4Size ??
          style?.heading4Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading4Size ??
          UpConstants.kDefaultStyleHeading4Size;
    case UpTextType.heading5:
      return override?.heading5Size ??
          style?.heading5Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading5Size ??
          UpConstants.kDefaultStyleHeading5Size;
    case UpTextType.heading6:
      return override?.heading6Size ??
          style?.heading6Size ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .heading6Size ??
          UpConstants.kDefaultStyleHeading6Size;
    case UpTextType.paragraph:
      return override?.paragraphSize ??
          style?.paragraphSize ??
          getStyleByType(UpConfig.of(context).theme, colorType)
              .paragraphSize ??
          UpConstants.kDefaultStyleParagrahSize;

    default:
      return override?.textSize ??
          style?.textSize ??
          getStyleByType(UpConfig.of(context).theme, colorType).textSize ??
          UpConstants.kDefaultStyleDefaultTextSize;
  }
}