AdaptiveContainer constructor
AdaptiveContainer({
- Key? key,
- AlignmentGeometry? alignment,
- EdgeInsetsGeometry? padding,
- Color? color,
- Decoration? decoration,
- Decoration? foregroundDecoration,
- EdgeInsetsGeometry? margin,
- Matrix4? transform,
- double? height,
- Widget? child,
- Clip clipBehavior = Clip.none,
- dynamic constraints,
- int columnSpan = 1,
Creates a widget that combines common painting, positioning, and sizing widgets.
The color
and decoration
arguments cannot both be supplied, since
it would potentially result in the decoration drawing over the background
color. To supply a decoration with a color, use decoration: BoxDecoration(color: color)
.
Implementation
AdaptiveContainer({
super.key,
this.alignment,
this.padding,
this.color,
this.decoration,
this.foregroundDecoration,
this.margin,
this.transform,
this.height,
this.child,
this.clipBehavior = Clip.none,
constraints,
this.columnSpan = 1,
}) : assert(margin == null || margin.isNonNegative),
assert(padding == null || padding.isNonNegative),
assert(decoration == null || decoration.debugAssertIsValid()),
assert(
color == null || decoration == null,
'Cannot provide both a color and a decoration\n'
'To provide both, use "decoration: BoxDecoration(color: color)".') {
this.constraints = constraints ?? const AdaptiveConstraints();
}