SimpleDropdown<T>.list constructor

SimpleDropdown<T>.list({
  1. Key? key,
  2. required WidgetBuilder builder,
  3. required DropdownController<T> controller,
  4. BoxConstraints? menuConstraints,
  5. BoxDecoration? menuDecoration,
  6. bool enableListen = true,
  7. DropdownMenuPosition menuPosition = const DropdownMenuPosition(),
  8. bool crossAxisConstrained = true,
  9. bool dismissible = true,
  10. bool enabled = true,
  11. required MenuItemBuilder<T> itemBuilder,
  12. IndexedWidgetBuilder? separatorBuilder,
  13. WidgetBuilder? loadingBuilder,
  14. WidgetBuilder? emptyListBuilder,
})

Implementation

SimpleDropdown.list({
  super.key,
  required this.builder,
  required this.controller,
  this.menuConstraints,
  this.menuDecoration,
  this.enableListen = true,
  this.menuPosition = const DropdownMenuPosition(),
  this.crossAxisConstrained = true,
  this.dismissible = true,
  this.enabled = true,

  /// The builder that will be used to build the items in the dropdown menu.
  required MenuItemBuilder<T> itemBuilder,

  /// The builder that will be used to build the separator in the dropdown menu.
  /// it would use [LiveView.separated] internally to build the dropdown menu if provided.
  IndexedWidgetBuilder? separatorBuilder,

  /// The builder that will be used to build the loading indicator in the dropdown menu.
  /// Default to a [CircularProgressIndicator] if not provided.
  WidgetBuilder? loadingBuilder,

  /// The builder that will be used to build the empty list indicator in the dropdown menu.
  /// Default to Text("No items") if not provided.
  WidgetBuilder? emptyListBuilder,
}) : delegate = ListViewMenuBuilderDelegate<T>(
        itemBuilder: itemBuilder,
        position: menuPosition,
        separatorBuilder: separatorBuilder,
        loadingBuilder: loadingBuilder,
        emptyListBuilder: emptyListBuilder,
      );