Selector<T> constructor
const
Selector<T> ({
- Key? key,
- bool canUnselect = false,
- T? value,
- ValueChanged<
T?> ? onChanged, - required List<
T> values, - required String labelBuilder(
- T
Initializes the Selector with required values list and label builder, along with optional current value, change callback, and unselect flag.
The constructor sets up the widget's state immutably, using the provided labelBuilder to generate display text for each item. If canUnselect is true, users can clear the selection by tapping the current value; otherwise, selection persists until changed. This supports integration with form providers like ArcaneFieldProvider for reactive updates.
Implementation
const Selector(
{super.key,
this.canUnselect = false,
this.value,
this.onChanged,
required this.values,
required this.labelBuilder});