sizeWithStyle method

Size sizeWithStyle(
  1. TextStyle style
)

Implementation

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