list<T> method
T
list<T>({
- required String label,
- required List<
T> options, - T? initialOption,
- String? description,
- LabelBuilder<
T> ? labelBuilder,
Allow the users to select from a list of options in a drop down box. Must contain at least one value.
Implementation
T list<T>({
required String label,
required List<T> options,
T? initialOption,
String? description,
LabelBuilder<T>? labelBuilder,
}) {
assert(options.isNotEmpty, 'Must specify at least one option');
return onKnobAdded(
ListKnob<T>(
label: label,
initialValue: initialOption ?? options.first,
description: description,
options: options,
labelBuilder: labelBuilder,
),
)!;
}