ViewConstraints class
Immutable layout constraints for FlutterViews.
Similar to BoxConstraints, a Size respects a ViewConstraints if, and only if, all of the following relations hold:
- minWidth <= Size.width <= maxWidth
- minHeight <= Size.height <= maxHeight
The constraints themselves must satisfy these relations:
- 0.0 <= minWidth <= maxWidth <= double.infinity
- 0.0 <= minHeight <= maxHeight <= double.infinity
For each constraint, double.infinity is a legal value.
For a generic class that represents these kind of constraints, see the BoxConstraints class.
Constructors
- ViewConstraints({double minWidth = 0.0, double maxWidth = double.infinity, double minHeight = 0.0, double maxHeight = double.infinity})
-
Creates view constraints with the given constraints.
const
- ViewConstraints.tight(Size size)
- Creates view constraints that is respected only by the given size.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- 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
Methods
-
isSatisfiedBy(
Size size) → bool - Whether the given size satisfies the constraints.
-
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 /(
double factor) → ViewConstraints - Scales each constraint parameter by the inverse of the given factor.
-
operator ==(
Object other) → bool -
The equality operator.
override