getSelection method

  1. @override
SelectedContentRange? getSelection()
override

Returns a SelectedContentRange considering the SelectedContentRange from each Selectable child managed under this delegate.

When nothing is selected or either selection edge has not been set, this method will return null.

Implementation

@override
SelectedContentRange? getSelection() {
  final List<_SelectionInfo> selections = <_SelectionInfo>[
    for (final Selectable selectable in selectables)
      (contentLength: selectable.contentLength, range: selectable.getSelection()),
  ];
  return _calculateLocalRange(selections);
}