ModalContainer constructor
const
ModalContainer({
- Key? key,
- required Widget child,
- EdgeInsetsGeometry? padding,
- bool filled = false,
- Color? fillColor,
- BorderRadiusGeometry? borderRadius,
- Clip clipBehavior = Clip.none,
- Color? borderColor,
- double? borderWidth,
- List<
BoxShadow> ? boxShadow, - double? surfaceOpacity,
- double? surfaceBlur,
- 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 containerpadding
(EdgeInsetsGeometry?, optional): inner padding around childfilled
(bool, default: false): whether to show background fillfillColor
(Color?, optional): background fill color when filled is trueborderRadius
(BorderRadiusGeometry?, optional): corner radiusclipBehavior
(Clip, default: Clip.none): clipping behavior for contentborderColor
(Color?, optional): border colorborderWidth
(double?, optional): border width in logical pixelsboxShadow
(ListsurfaceOpacity
(double?, optional): backdrop opacity levelsurfaceBlur
(double?, optional): backdrop blur intensityduration
(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,
});