setSelectionRects method Null safety

void setSelectionRects(
  1. List<SelectionRect> selectionRects
)

Send the bounding boxes of the current selected glyphs in the client to the platform's text input plugin.

These are used by the engine during a UIDirectScribbleInteraction.

Implementation

void setSelectionRects(List<SelectionRect> selectionRects) {
  if (!listEquals(_cachedSelectionRects, selectionRects)) {
    _cachedSelectionRects = selectionRects;
    TextInput._instance._setSelectionRects(selectionRects.map((SelectionRect rect) {
      return <num>[rect.bounds.left, rect.bounds.top, rect.bounds.width, rect.bounds.height, rect.position];
    }).toList());
  }
}