LayoutConstraints class
Defines the size constraints for layout calculations.
LayoutConstraints specify the minimum and maximum allowable dimensions for an element during layout. The layout algorithm must respect these constraints when determining final sizes.
Constructors
- LayoutConstraints.new({double minWidth = 0.0, double maxWidth = double.infinity, double minHeight = 0.0, double maxHeight = double.infinity})
-
Creates constraints with the specified bounds.
const
- LayoutConstraints.tight(LayoutSize size)
- Creates tight constraints that exactly match the given size.
- LayoutConstraints.tightFor({double? width, double? height})
-
Creates tight constraints for a specific width and/or height.
const
Properties
- biggest → LayoutSize
-
The largest size that satisfies these constraints.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isTight → bool
-
no setter
- maxHeight → double
-
The maximum allowed height.
final
- maxWidth → double
-
The maximum allowed width.
final
- minHeight → double
-
The minimum allowed height.
final
- minWidth → double
-
The minimum allowed width.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- smallest → LayoutSize
-
The smallest size that satisfies these constraints.
no setter
Methods
-
constrain(
LayoutSize size) → LayoutSize - Constrains a size to fit within these constraints.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited