showCustomModalBottomSheetDrag static method
void
showCustomModalBottomSheetDrag({
- required BuildContext context,
- required dynamic modal(
- ScrollController controller
- double radius = 24,
- bool isDrag = true,
- bool isDismissible = true,
- double paddingTop = 200,
- 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);
},
),
);
}