onSelectionChanged property
final
The function that is called when the selection changes.
The callback's parameter indicates which of the segments are selected.
When the callback is null, the entire SegmentedButton is disabled, and will not respond to input.
The default is null.
Implementation
final void Function(Set<T>)? onSelectionChanged;