showCustomModalBottomSheetDrag static method

void showCustomModalBottomSheetDrag({
  1. required BuildContext context,
  2. required dynamic modal(
    1. ScrollController controller
    ),
  3. double radius = 24,
  4. bool isDrag = true,
  5. bool isDismissible = true,
  6. double paddingTop = 200,
  7. double maxChildSize = 0.9,
})

Implementation

static void showCustomModalBottomSheetDrag({
  required BuildContext context,
  required Function(ScrollController controller) modal,
  double radius = 24,
  bool isDrag = true,
  bool isDismissible = true,
  double paddingTop = 200,
  double maxChildSize = 0.9,
}) {
  showModalBottomSheet(
    isDismissible: isDismissible,
    enableDrag: isDrag,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.only(
        topLeft: Radius.circular(radius.r),
        topRight: Radius.circular(radius.r),
      ),
    ),
    isScrollControlled: true,
    constraints: BoxConstraints(
      maxHeight: MediaQuery.sizeOf(context).height - paddingTop.r,
    ),
    backgroundColor: CustomStyle.transparent,
    context: context,
    builder: (context) => DraggableScrollableSheet(
      initialChildSize: maxChildSize,
      maxChildSize: maxChildSize,
      expand: false,
      builder: (BuildContext context, ScrollController scrollController) {
        return modal(scrollController);
      },
    ),
  );
}