getBoxesForSelection method Null safety
- TextSelection selection
Returns a list of rects that bound the given selection.
See TextPainter.getBoxesForSelection for more details.
Implementation
List<Rect> getBoxesForSelection(TextSelection selection) {
_computeTextMetricsIfNeeded();
return _textPainter.getBoxesForSelection(selection)
.map((TextBox textBox) => textBox.toRect().shift(_paintOffset))
.toList();
}