resetSelectionsToHeaderSelection method

UserSelectionState resetSelectionsToHeaderSelection({
  1. required Axis axis,
  2. required int anchor,
  3. required int focus,
})

Reset all selections to a single HeaderUserSelectionModel created from anchor, focus and axis.

The resulting lone selection copies everything from the primarySelection besides anchor, focus and axis.

Implementation

UserSelectionState resetSelectionsToHeaderSelection({
  required Axis axis,
  required int anchor,
  required int focus,
}) {
  final newList = BuiltList<UserSelectionModel>.from(
    <UserSelectionModel>[
      HeaderUserSelectionModel.fromSelectionModel(
        primarySelection,
        anchor: anchor,
        focus: focus,
        axis: axis,
      ),
    ],
  );
  return UserSelectionState._(newList);
}