addSelectionUpdatedListener method

void addSelectionUpdatedListener(
  1. SelectionModelListener<D> listener
)

Add a listener to be notified when updateSelection is called, even if the selection state is the same.

This is necessary in order to support programmatic selections in Flutter. Due to the way widgets are constructed in Flutter, there currently isn't a way for users to programmatically specify the selection. In order to provide this support, the users who subscribe to the selection updated event can keep a copy of the selection model and also decide if it should be overwritten.

Implementation

void addSelectionUpdatedListener(SelectionModelListener<D> listener) {
  _updatedListeners.add(listener);
}