showDropDown method
dynamic
showDropDown({
- String title = "",
- double heightView = 300,
- List<
OptionItem> items = const [], - bool isSearch = false,
- CallbackData? callback,
- String hindText = "",
- Widget? childPopup,
- OptionItem? initItem,
inherited
Implementation
showDropDown({
String title = "",
double heightView = 300,
List<OptionItem> items = const [],
// required this.context,
bool isSearch = false,
CallbackData? callback,
String hindText = "",
Widget? childPopup,
OptionItem? initItem,
}) {
FocusScope.of(context).unfocus();
var height = heightView;
if (items.isNotEmpty) {
height = (items.length * 42 + 150);
}
if (height <= 330) {
height = 330;
}
if (height >= Get.height - 100) {
height = Get.height - 100;
}
showModalBottomSheet<void>(
backgroundColor: Colors.transparent,
isScrollControlled: true,
isDismissible: true,
context: context,
builder: (BuildContext context) {
return SizedBox(
height: height,
child: ViewSearchContent(
isSearch: isSearch,
title: title,
childPopup: childPopup,
items: items,
callback: (value) {
if (callback != null) {
callback(value);
}
// setState(() {});
},
listData: const [],
),
);
});
}