openSheet<T> function

Future<T?> openSheet<T>({
  1. required BuildContext context,
  2. required WidgetBuilder builder,
  3. required OverlayPosition position,
  4. bool barrierDismissible = true,
  5. bool transformBackdrop = false,
  6. Color? barrierColor,
})

Implementation

Future<T?> openSheet<T>({
  required BuildContext context,
  required WidgetBuilder builder,
  required OverlayPosition position,
  bool barrierDismissible = true,
  bool transformBackdrop = false,
  Color? barrierColor,
}) {
  return openRawDrawer<T>(
    context: context,
    transformBackdrop: transformBackdrop,
    barrierDismissible: barrierDismissible,
    useSafeArea: false, // handled by the sheet itself
    builder: (context, extraSize, size, padding, stackIndex) {
      return SheetWrapper(
        position: position,
        expands: true,
        extraSize: extraSize,
        size: size,
        padding: padding,
        barrierColor: barrierColor,
        stackIndex: stackIndex,
        child: builder(context),
      );
    },
    position: position,
  ).future;
}