showDropdown<T> static method
void
showDropdown<T>({
- required BuildContext context,
- required List<
T> items, - required String title,
- required dynamic onItemSelected(
- T?
- BottomSheetMode bottomSheetMode = BottomSheetMode.normal,
- bool showSearch = true,
- Widget itemBuilder(
- T
- bool itemSearchCondition(
- T,
- String
- 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);
}