BoxConstraints class

Immutable layout constraints with min/max width and height.

Follows Flutter's BoxConstraints API: BoxConstraints.tight, BoxConstraints.loose, BoxConstraints.expand, BoxConstraints.tightFor. Use deflate to subtract padding, enforce to clamp to another constraint.

Inheritance

Constructors

BoxConstraints({int minWidth = 0, int maxWidth = Constraints.infinity, int minHeight = 0, int maxHeight = Constraints.infinity})
const
BoxConstraints.expand({int? width, int? height})
const
BoxConstraints.loose(Size size)
BoxConstraints.tight(Size size)
BoxConstraints.tightFor({int? width, int? height})
const

Properties

asBoxConstraints BoxConstraints
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
isNormalized bool
no setter
isTight bool
no setter
maxHeight int
final
maxWidth int
final
minHeight int
final
minWidth int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

constrain(Size size) Size
deflate(EdgeInsets edge) BoxConstraints
enforce(BoxConstraints constraints) BoxConstraints
loosen() BoxConstraints
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override