OpenCustomSheet.scrollableSheet constructor

OpenCustomSheet.scrollableSheet(
  1. BuildContext context, {
  2. required Widget body({
    1. ScrollController? scrollController,
    }),
  3. dynamic onClose(
    1. dynamic
    )?,
  4. bool expand = true,
  5. double initialChildSize = 0.5,
  6. double minChildSize = 0.25,
  7. double maxChildSize = 1.0,
  8. Color? barrierColor,
  9. Color? backgroundColor,
  10. Color? handleColor,
  11. bool barrierDismissible = true,
  12. ShapeBorder? sheetShape,
  13. EdgeInsetsGeometry? sheetPadding,
})

Factory constructor to create a scrollable sheet without default action buttons.

This is useful for displaying large amounts of content that require scrolling.

Example usage:

OpenCustomSheet.scrollableSheet(
  context,
  body: ({scrollController}) => ListView.builder(
    controller: scrollController,
    itemCount: 50,
    itemBuilder: (context, index) => ListTile(title: Text('Item $index')),
  ),
);

Implementation

factory OpenCustomSheet.scrollableSheet(
  BuildContext context, {
  required Widget Function({ScrollController? scrollController}) body,
  Function(dynamic)? onClose,
  bool expand = true,
  double initialChildSize = 0.5,
  double minChildSize = 0.25,
  double maxChildSize = 1.0,
  Color? barrierColor,
  Color? backgroundColor,
  Color? handleColor,
  bool barrierDismissible = true,
  ShapeBorder? sheetShape,
  EdgeInsetsGeometry? sheetPadding,
}) {
  return OpenCustomSheet(
    scrollable: true,
    expand: expand,
    initialChildSize: initialChildSize,
    minChildSize: minChildSize,
    maxChildSize: maxChildSize,
    onClose: onClose,
    barrierColor: barrierColor,
    barrierDismissible: barrierDismissible,
    backgroundColor: backgroundColor,
    handleColor: handleColor,
    sheetShape: sheetShape,
    sheetPadding: sheetPadding,
    showDefaultButtons: false,
    // Disable default buttons for scrollable sheet
    body: body,
  );
}