updateSelection method

SelectionT? updateSelection({
  1. required SelectionT? currentSelection,
  2. required PositionT? position,
  3. required SelectionT extendSelection(
    1. SelectionT currentSelection,
    2. PositionT position
    ),
  4. required SelectionT? extendLineSelection(
    1. int anchorRow,
    2. PositionT position
    ),
})

Implementation

SelectionT? updateSelection({
  required SelectionT? currentSelection,
  required PositionT? position,
  required SelectionT Function(
    SelectionT currentSelection,
    PositionT position,
  )
  extendSelection,
  required SelectionT? Function(int anchorRow, PositionT position)
  extendLineSelection,
}) {
  if (currentSelection == null || position == null) {
    return null;
  }
  final anchorRow = session.lineSelectionAnchorRow;
  return anchorRow == null
      ? extendSelection(currentSelection, position)
      : extendLineSelection(anchorRow, position);
}