getTextHeight method

double getTextHeight(
  1. BuildContext context, {
  2. double fontSize = 18,
})

Implementation

double getTextHeight(BuildContext context, {double fontSize = 18}) {
  TextScaler textScaler = MediaQuery.of(context).textScaler;

  double calculatedFontSize = textScaler.scale(fontSize);

  Size textHeight = Linebar.calculateTextSize(
    'L',
    style: TextStyle(
      color: widget.options.linebarTextColor,
      fontSize: calculatedFontSize,
      fontFamily: widget.options.fontFamily,
    ),
    context: context,
  );

  return textHeight.height;
}