textHeight method
Implementation
double textHeight(
double textWidth, {
TextStyle? style,
}) {
final TextPainter textPainter = TextPainter(
text: TextSpan(text: this, style: style),
maxLines: 20,
textDirection: UIData.ltr)
..layout(minWidth: 0, maxWidth: double.infinity);
final countLines = (textPainter.size.width / textWidth).ceil();
final height = countLines * textPainter.size.height;
return height;
}