BoxConstraints class
Defines layout boundaries inside terminal cell limits.
Constructors
- BoxConstraints({int minWidth = 0, int maxWidth = infinity, int minHeight = 0, int maxHeight = infinity})
-
Creates box constraints with the given limits.
const
- BoxConstraints.loose(Size size)
- Creates box constraints that forbid sizes larger than the given size.
- BoxConstraints.tight(Size size)
- Creates box constraints that require the given size exactly.
- BoxConstraints.tightFor({int? width, int? height})
-
Creates box constraints that require the given width or height.
const
Properties
- hasBoundedHeight → bool
-
Whether the maximum height is bounded.
no setter
- hasBoundedWidth → bool
-
Whether the maximum width is bounded.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTight → bool
-
Whether the constraints are tight (min and max match for both width and height).
no setter
- maxHeight → int
-
The maximum height allowed.
final
- maxWidth → int
-
The maximum width allowed.
final
- minHeight → int
-
The minimum height allowed.
final
- minWidth → int
-
The minimum width allowed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
constrain(
Size size) → Size - Clamps the input Size within these constraints.
-
copyWith(
{int? minWidth, int? maxWidth, int? minHeight, int? maxHeight}) → BoxConstraints - Creates a copy of this BoxConstraints with updated values.
-
enforce(
BoxConstraints constraints) → BoxConstraints -
Enforces the given
constraintson this constraint. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
tighten(
{int? width, int? height}) → BoxConstraints - Tightens the constraints with the given width and height.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited