listOrNull<T> method

T? listOrNull<T>({
  1. required String label,
  2. required List<T?> options,
  3. T? initialOption,
  4. String? description,
  5. LabelBuilder<T?>? labelBuilder,
})

Allow the users to select from a list of options in a drop down box that might contain a null value.

Implementation

T? listOrNull<T>({
  required String label,
  required List<T?> options,
  T? initialOption,
  String? description,
  LabelBuilder<T?>? labelBuilder,
}) {
  return onKnobAdded(
    ListKnob<T?>.nullable(
      label: label,
      initialValue: initialOption,
      description: description,
      options: options,
      labelBuilder: labelBuilder,
    ),
  );
}