BoxConstraints class

Annotations
  • @immutable

Constructors

BoxConstraints({double minWidth = 0.0, double maxWidth = double.infinity, double minHeight = 0.0, double maxHeight = double.infinity})
Creates box constraints with the given constraints.
const
BoxConstraints.expand({double? width, double? height})
Creates box constraints that expand to fill another box constraints.
const
BoxConstraints.tight(PdfPoint size)
Creates box constraints that is respected only by the given size.
BoxConstraints.tightFor({double? width, double? height})
Creates box constraints that require the given width or height.
const
BoxConstraints.tightForFinite({double width = double.infinity, double height = double.infinity})
const

Properties

biggest → PdfPoint
The biggest size that satisfies the constraints.
no setter
hasBoundedHeight → bool
no setter
hasBoundedWidth → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasInfiniteHeight → bool
no setter
hasInfiniteWidth → bool
no setter
hasTightHeight → bool
Whether there is exactly one height value that satisfies the constraints.
no setter
hasTightWidth → bool
Whether there is exactly one width value that satisfies the constraints.
no setter
isTight → bool
Whether there is exactly one size that satisfies the constraints.
no setter
maxHeight → double
The maximum height that satisfies the constraints.
final
maxWidth → double
The maximum width that satisfies the constraints.
final
minHeight → double
The minimum height that satisfies the constraints.
final
minWidth → double
The minimum width that satisfies the constraints.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
smallest → PdfPoint
The smallest size that satisfies the constraints.
no setter

Methods

constrain(PdfPoint size) → PdfPoint
constrainHeight([double height = double.infinity]) → double
constrainRect({double width = double.infinity, double height = double.infinity}) → PdfRect
constrainSizeAndAttemptToPreserveAspectRatio(PdfPoint size) → PdfPoint
Returns a size that attempts to meet the conditions
constrainWidth([double width = double.infinity]) → double
copyWith({double? minWidth, double? maxWidth, double? minHeight, double? maxHeight}) → BoxConstraints
debugAssertIsValid() → bool
deflate(EdgeInsets edges) → BoxConstraints
Returns new box constraints that are smaller by the given edge dimensions.
enforce(BoxConstraints constraints) → BoxConstraints
Returns new box constraints that respect the given constraints while being as close as possible to the original constraints.
loosen() → BoxConstraints
Returns new box constraints that remove the minimum width and height requirements.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tighten({double? width, double? height}) → BoxConstraints
Returns new box constraints with a tight width and/or height as close to the given width and height as possible while still respecting the original box constraints.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited