MyContainer constructor
const
MyContainer({
- Key? key,
- Widget? child,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- Color? color,
- Decoration? decoration,
- Decoration? foregroundDecoration,
- AlignmentGeometry? alignment,
- double? width,
- double? height,
- BoxConstraints? constraints,
- Matrix4? transform,
- AlignmentGeometry? transformAlignment,
- Clip clipBehavior = Clip.none,
- BoxBorder? border,
- BorderRadiusGeometry? borderRadius,
- List<
BoxShadow> ? boxShadow, - Gradient? gradient,
- BoxShape shape = BoxShape.rectangle,
- DecorationImage? image,
Creates a customized Container widget.
Implementation
const MyContainer({
super.key,
this.child,
this.padding,
this.margin,
this.color,
this.decoration,
this.foregroundDecoration,
this.alignment,
this.width,
this.height,
this.constraints,
this.transform,
this.transformAlignment,
this.clipBehavior = Clip.none,
// Initialize common decoration properties
this.border,
this.borderRadius,
this.boxShadow,
this.gradient,
this.shape = BoxShape.rectangle, // Default shape
this.image,
}) : assert(shape != BoxShape.circle || borderRadius == null,
'A borderRadius cannot be given when the shape is BoxShape.circle.');