showModernFormFilterPopupMenu<T> function

Future<T?> showModernFormFilterPopupMenu<T>(
  1. BuildContext context, {
  2. required List<ModernFormBottomSheetModel<T>> list,
  3. String? title,
  4. ModernFormPopupMenuLocation? menuLocation,
  5. 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);
  }
}