FutureComboBox<T>.eternal constructor

FutureComboBox<T>.eternal({
  1. String? label,
  2. Widget loaderBuilder()?,
  3. VitComboBoxStyle? style,
})

A combobox that a future that only finishes after a day.

Implementation

factory FutureComboBox.eternal({
  String? label,
  Widget Function()? loaderBuilder,
  VitComboBoxStyle? style,
}) {
  return FutureComboBox(
    label: label,
    loaderBuilder: loaderBuilder,
    style: style,
    options: Future.delayed(const Duration(days: 1), () {
      return {};
    }),
    itemBuilder: (item) {
      throw Exception('Tried to render item in eternal future combo box');
    },
    onSelected: (item) => null,
  );
}