getFontSize method

double getFontSize(
  1. BuildContext context, {
  2. FastButtonSize? size,
  3. TextStyle? textStyle,
})

Implementation

double getFontSize(
  BuildContext context, {
  FastButtonSize? size,
  TextStyle? textStyle,
}) {
  if (textStyle != null && textStyle.fontSize != null) {
    return textStyle.fontSize!;
  }

  if (size != null) {
    switch (size) {
      case FastButtonSize.large:
        return FastButtonSpec.large.fontSize;
      case FastButtonSize.medium:
        return FastButtonSpec.medium.fontSize;
      case FastButtonSize.small:
        return FastButtonSpec.small.fontSize;
    }
  }

  return kFastFontSize16;
}