updateInitialSelected method

void updateInitialSelected(
  1. List<bool> selection
)

Updates the baseline selection state for drag selection operations.

This method sets the reference point for range selection calculations. When drag selection is active, items are toggled relative to this initial state rather than their current state.

When to Call

This method should be called:

  • At the start of each drag selection operation
  • Whenever the baseline for range calculations needs to change
  • Typically called automatically by DragSelectableListView

Selection Logic

During drag selection:

This provides intuitive behavior where users can select unselected items and deselect selected items within the same drag operation.

Implementation

void updateInitialSelected(List<bool> selection) {
  initialSelected = List.from(selection);
  notifyListeners();
}