LimitedBox constructor Null safety

const LimitedBox(
  1. {Key? key,
  2. double maxWidth = double.infinity,
  3. double maxHeight = double.infinity,
  4. Widget? child}
)

Creates a box that limits its size only when it's unconstrained.

The maxWidth and maxHeight arguments must not be null and must not be negative.

Implementation

const LimitedBox({
  super.key,
  this.maxWidth = double.infinity,
  this.maxHeight = double.infinity,
  super.child,
}) : assert(maxWidth != null && maxWidth >= 0.0),
     assert(maxHeight != null && maxHeight >= 0.0);