onSelected property
The callback invoked when an option is selected.
You can prevent the overlay from closing by returning false
.
If optionsBuilder is given, then this parameter must not be provided.
Implementation
final FutureOr<bool?> Function(T key)? onSelected;