boundingTextSize static method
Implementation
static Size boundingTextSize(String text, TextStyle style,
{int maxLines = 2 ^ 31, double maxWidth = double.infinity}) {
if (text.isEmpty) {
return const Size(0, 0);
}
final TextPainter textPainter = TextPainter(
textDirection: TextDirection.ltr,
text: TextSpan(text: text, style: style),
maxLines: maxLines)
..layout(maxWidth: maxWidth);
return textPainter.size;
}