Skip to content

BoxConstraints

BoxConstraints #

Constraints that must be respected by a size of a box.

A Size respects a BoxConstraints if, and only if, all of the following relations hold:

min_width <= Size.width <= max_width
min_height <= Size.height <= max_height

Read more about BoxConstraints here.

max_height #

max_height: Number = float('inf')

The maximum height that satisfies the constraints, such that min_height <= max_height <= float("inf").

max_width #

max_width: Number = float('inf')

The maximum width that satisfies the constraints, such that min_width <= max_width <= float("inf").

min_height #

min_height: Number = 0

The minimum height that satisfies the constraints, such that 0.0 <= min_height <= max_height.

min_width #

min_width: Number = 0

The minimum width that satisfies the constraints, such that 0.0 <= min_width <= max_width.

copy_with #

copy_with(
    *,
    min_width: Number | None = None,
    min_height: Number | None = None,
    max_width: Number | None = None,
    max_height: Number | None = None,
) -> BoxConstraints

Returns a copy of this object with the specified properties overridden.