showDropdown<T> static method

void showDropdown<T>({
  1. required BuildContext context,
  2. required List<T> items,
  3. required String title,
  4. required dynamic onItemSelected(
    1. T?
    ),
  5. BottomSheetMode bottomSheetMode = BottomSheetMode.normal,
  6. bool showSearch = true,
  7. Widget itemBuilder(
    1. T
    )?,
  8. bool itemSearchCondition(
    1. T,
    2. String
    )?,
  9. CustomDropdownTheme? theme,
})

Implementation

static void showDropdown<T>({
  required BuildContext context,
  required List<T> items,
  required String title,
  required Function(T?) onItemSelected,
  //optional
  BottomSheetMode bottomSheetMode = BottomSheetMode.normal,
  bool showSearch = true,
  Widget Function(T)? itemBuilder,
  bool Function(T, String)? itemSearchCondition,
  CustomDropdownTheme? theme,
}) {
  // Check if the items list is empty
  _checkItemsList(items);

  // Check if the item class has override toString()
  if (itemBuilder == null) {
    _checkToStringOverride(items);
  }

  _showCustomDropdown(
      context: context,
      items: items,
      title: title,
      onItemSelected: onItemSelected,
      bottomSheetMode: bottomSheetMode,
      showSearch: showSearch,
      itemBuilder: itemBuilder,
      itemSearchCondition: itemSearchCondition,
      theme: theme);
}