getTextSize method

Size getTextSize()

Implementation

Size getTextSize() {
  TextPainter textPainter = TextPainter(
    text: renderEditable!.text,
    maxLines: _maxLines,
    textDirection: TextDirection.ltr
  );

  double maxWidth = isMultiline
    ? renderEditable!.size.width
    : double.infinity;

  textPainter.layout(maxWidth: maxWidth);

  return textPainter.size;
}