paintTextSize method

Size paintTextSize(
  1. TextStyle style, {
  2. double maxWidth = double.infinity,
})

Implementation

Size paintTextSize(TextStyle style, {double maxWidth = double.infinity}) {
  final textPainter =
      TextPainter(text: TextSpan(text: this, style: style), maxLines: 1, textDirection: TextDirection.ltr)
        ..layout(minWidth: 0, maxWidth: maxWidth);
  return textPainter.size;
}