setSelections method

void setSelections(
  1. Iterable<Span> ranges, {
  2. int? primary,
  3. Map? options,
})

Sets a new set of selections. There must be at least one selection in the given array. When primary is a number, it determines which selection is the primary one. When it is not given, the primary index is taken from the previous selection, or set to the last range if the previous selection had less ranges than the new one. Supports the same options as setSelection.

Implementation

void setSelections(Iterable<Span> ranges, {int? primary, Map? options}) {
  callArgs('setSelections', [
    JsArray.from(ranges.map((Span range) => range.toProxy())),
    primary,
    options
  ]);
}