ListField<T> constructor
ListField<T> ({
- required String name,
- required List<
T> values, - required T? initialValue,
- LabelBuilder<
T> labelBuilder = defaultLabelBuilder, - @Deprecated('Fields should not be aware of their context') void onChanged(
- BuildContext context,
- T? value
Implementation
ListField({
required super.name,
required this.values,
required super.initialValue,
this.labelBuilder = defaultLabelBuilder,
@Deprecated('Fields should not be aware of their context') super.onChanged,
}) : super(
type: FieldType.list,
codec: FieldCodec(
toParam: labelBuilder,
toValue: (param) => values.firstWhereOrNull(
(value) => labelBuilder(value) == param,
),
),
);