AdaptiveContainer constructor

AdaptiveContainer({
  1. Key? key,
  2. AlignmentGeometry? alignment,
  3. EdgeInsetsGeometry? padding,
  4. Color? color,
  5. Decoration? decoration,
  6. Decoration? foregroundDecoration,
  7. EdgeInsetsGeometry? margin,
  8. Matrix4? transform,
  9. double? height,
  10. Widget? child,
  11. Clip clipBehavior = Clip.none,
  12. dynamic constraints,
  13. 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();
}