ListSelectControl<K, T>.ofValue constructor
ListSelectControl<K, T>.ofValue ({
- Key? key,
- required KeyedOptionsHandler<
K, T> handler, - required TypeaheadHandler<
K, T> viewHandler, - required String id,
- String? selectedType,
- FormValueChanged<
List< ? onChange,T?> > - bool isRequired = false,
- Iterable<
T> ? initialValue, - String? placeholder,
- FocusNode? focusNode,
Implementation
ListSelectControl.ofValue({
Key? key,
required this.handler,
required this.viewHandler,
required this.id,
this.selectedType,
FormValueChanged<List<T?>>? onChange,
this.isRequired = false,
Iterable<T>? initialValue,
this.placeholder,
this.focusNode,
}) : onChange = ((options, source) {
// Unbox the option as values
final mapped = options.map((o) => o?.value).notNullList().toList();
onChange?.call(mapped, source);
}),
initialValue = initialValue?.map(handler.toKey).notNull(),
super(key: key);