openDrawer<T> function

Future<T?> openDrawer<T>({
  1. required BuildContext context,
  2. required WidgetBuilder builder,
  3. required OverlayPosition position,
  4. bool expands = false,
  5. bool draggable = true,
  6. bool barrierDismissible = true,
  7. WidgetBuilder? backdropBuilder,
  8. bool useSafeArea = true,
  9. bool showDragHandle = true,
  10. BorderRadiusGeometry? borderRadius,
  11. Size? dragHandleSize,
  12. bool transformBackdrop = true,
  13. double? surfaceOpacity,
  14. double? surfaceBlur,
  15. Color? barrierColor,
})

Implementation

Future<T?> openDrawer<T>({
  required BuildContext context,
  required WidgetBuilder builder,
  required OverlayPosition position,
  bool expands = false,
  bool draggable = true,
  bool barrierDismissible = true,
  WidgetBuilder? backdropBuilder,
  bool useSafeArea = true,
  bool showDragHandle = true,
  BorderRadiusGeometry? borderRadius,
  Size? dragHandleSize,
  bool transformBackdrop = true,
  double? surfaceOpacity,
  double? surfaceBlur,
  Color? barrierColor,
}) {
  return openRawDrawer<T>(
    context: context,
    barrierDismissible: barrierDismissible,
    backdropBuilder: backdropBuilder,
    useSafeArea: useSafeArea,
    transformBackdrop: transformBackdrop,
    builder: (context, extraSize, size, padding, stackIndex) {
      return DrawerWrapper(
        position: position,
        expands: expands,
        draggable: draggable,
        extraSize: extraSize,
        size: size,
        showDragHandle: showDragHandle,
        dragHandleSize: dragHandleSize,
        padding: padding,
        borderRadius: borderRadius,
        surfaceOpacity: surfaceOpacity,
        surfaceBlur: surfaceBlur,
        barrierColor: barrierColor,
        stackIndex: stackIndex,
        child: builder(context),
      );
    },
    position: position,
  ).future;
}