ModalBackdrop constructor

const ModalBackdrop({
  1. Key? key,
  2. bool? modal,
  3. bool? surfaceClip,
  4. BorderRadiusGeometry? borderRadius,
  5. Color? barrierColor,
  6. EdgeInsetsGeometry? padding,
  7. Animation<double>? fadeAnimation,
  8. required Widget child,
})

Creates a ModalBackdrop.

The child parameter is required and represents the content to display above the backdrop.

Parameters:

  • child (Widget, required): content widget displayed above backdrop
  • modal (bool?, optional): enables modal behavior, defaults to true
  • surfaceClip (bool?, optional): enables surface clipping, defaults to true
  • borderRadius (BorderRadiusGeometry?, optional): corner radius for cutout
  • barrierColor (Color?, optional): backdrop color, defaults to black with 80% opacity
  • padding (EdgeInsetsGeometry?, optional): padding around child
  • fadeAnimation (Animation

Example:

ModalBackdrop(
  barrierColor: Colors.black54,
  fadeAnimation: slideController,
  child: AlertDialog(title: Text('Alert')),
)

Implementation

const ModalBackdrop({
  super.key,
  this.modal,
  this.surfaceClip,
  this.borderRadius,
  this.barrierColor,
  this.padding,
  this.fadeAnimation,
  required this.child,
});