DropDownWithArgs<T> typedef

DropDownWithArgs<T> = Widget Function(List<T> options, ValueChanged<T> onSelected, TextEditingController controller)

A function type definition for creating a dropdown widget.

This function type expects a list of options, and a callback function to notify when an option is selected. The generic type T is used to denote the type of the options in the dropdown.

Parameters:

  • options: A list of type T which contains the dropdown options.
  • onSelected: A callback function of type ValueChanged<T> which gets triggered when an option is selected.
  • controller: The TextEditingController for the text search field.

Returns:

  • Widget: The dropdown widget created using the provided parameters.

Implementation

typedef DropDownWithArgs<T> = Widget Function(
  List<T> options,
  ValueChanged<T> onSelected,
  TextEditingController controller,
);