LayoutConstraints.loose constructor

const LayoutConstraints.loose(
  1. Vector2 size
)

Zero to size in both axes. Aliases size rather than copying, so it must already be immutable - this is checked with an assertion. Copy a mutable size with Vector2.copy first if needed.

Implementation

const LayoutConstraints.loose(Vector2 size)
  : assert(
      size is! MVector2,
      'size must be immutable. '
      'Copy it with Vector2.copy first.',
    ),
    min = .zero,
    max = size;