clearSelection method

void clearSelection({
  1. bool restoreInitialSelection = true,
})

Clear the current selection.

When restoreInitialSelection is true, the dropdown returns to the initial selection it started with (if any). When it is false, the dropdown is cleared completely and the hint/header placeholder is shown.

This works whether the overlay is currently open or closed.

Implementation

void clearSelection({bool restoreInitialSelection = true}) {
  _state?._clearSelection(
    restoreInitialSelection: restoreInitialSelection,
  );
}