VitComboBox<T>.itemBuilder constructor

VitComboBox<T>.itemBuilder({
  1. required Set<T> options,
  2. required Widget itemBuilder(
    1. T item
    ),
  3. required FutureOr<bool?> onSelected(
    1. T key
    ),
  4. Widget selectedItemBuilder(
    1. T? selection
    )?,
  5. void onClose()?,
  6. String? label,
  7. VitComboBoxStyle? style,
  8. T? selection,
  9. Widget? trailing,
  10. bool enabled = true,
})

Creates a combobox with option overlay using the ListView and itemBuilder.

Implementation

factory VitComboBox.itemBuilder({
  required Set<T> options,
  required Widget Function(T item) itemBuilder,
  required FutureOr<bool?> Function(T key) onSelected,
  Widget Function(T? selection)? selectedItemBuilder,
  void Function()? onClose,
  String? label,
  VitComboBoxStyle? style,
  T? selection,
  Widget? trailing,
  bool enabled = true,
}) {
  return VitComboBox._(
    options: options,
    itemBuilder: itemBuilder,
    selectedItemBuilder: selectedItemBuilder,
    onSelected: onSelected,
    style: style,
    enabled: enabled,
    label: label,
    onClose: onClose,
    selection: selection,
    trailing: trailing,
  );
}