ModalContainer constructor

const ModalContainer({
  1. Key? key,
  2. required Widget child,
  3. EdgeInsetsGeometry? padding,
  4. bool filled = false,
  5. Color? fillColor,
  6. BorderRadiusGeometry? borderRadius,
  7. Clip clipBehavior = Clip.none,
  8. Color? borderColor,
  9. double? borderWidth,
  10. List<BoxShadow>? boxShadow,
  11. double? surfaceOpacity,
  12. double? surfaceBlur,
  13. Duration? duration,
})

Creates a ModalContainer.

The child parameter is required. Other parameters customize the container's appearance and behavior.

Parameters:

  • child (Widget, required): content to display in the container
  • padding (EdgeInsetsGeometry?, optional): inner padding around child
  • filled (bool, default: false): whether to show background fill
  • fillColor (Color?, optional): background fill color when filled is true
  • borderRadius (BorderRadiusGeometry?, optional): corner radius
  • clipBehavior (Clip, default: Clip.none): clipping behavior for content
  • borderColor (Color?, optional): border color
  • borderWidth (double?, optional): border width in logical pixels
  • boxShadow (List
  • surfaceOpacity (double?, optional): backdrop opacity level
  • surfaceBlur (double?, optional): backdrop blur intensity
  • duration (Duration?, optional): animation duration for transitions

Example:

ModalContainer(
  filled: true,
  padding: EdgeInsets.all(24),
  borderRadius: BorderRadius.circular(8),
  child: Text('Modal Content'),
)

Implementation

const ModalContainer({
  super.key,
  required this.child,
  this.padding,
  this.filled = false,
  this.fillColor,
  this.borderRadius,
  this.clipBehavior = Clip.none,
  this.borderColor,
  this.borderWidth,
  this.boxShadow,
  this.surfaceOpacity,
  this.surfaceBlur,
  this.duration,
});