showModernFormFilterPopupMenu<T> function
Future<T?>
showModernFormFilterPopupMenu<T>(
- BuildContext context, {
- required List<
ModernFormBottomSheetModel< list,T> > - String? title,
- bool? forceMenu,
Implementation
Future<T?> showModernFormFilterPopupMenu<T>(
BuildContext context, {
required List<ModernFormBottomSheetModel<T>> list,
String? title,
menu.ModernFormPopupMenuLocation? menuLocation,
bool? forceMenu,
}) async {
Size size = MediaQuery.of(context).size;
bool isLargeDevice = size.width > ModernFormUtils.webBreakdown;
int listLength = list.length;
if (forceMenu == null) {
forceMenu = listLength <= _lengthForBottomSheet;
}
if (forceMenu) {
return _showPopupMenu(context, list: list, menuLocation: menuLocation);
} else if (listLength >= _lengthForPageList) {
return showModernFormFilterPopupMenuPageList(list: list, title: title);
} else if (isLargeDevice) {
return _showPopupMenu(context, list: list, menuLocation: menuLocation);
} else {
return _showBottomSheet(context, list: list, title: title);
}
}