Add even more careful checks around BoxConstraints (#3243)

I ran into a case where I was setting minHeight=∞ and then calling
layout() with that constraint, which is all kinds of bad. To try to
catch this earlier, this patch now provides a way to catch constraints
that are requiring infinite values.

We don't _always_ check this because there are valid uses for
BoxConstraints.biggest, e.g. as an additionalConstraint.
This commit is contained in:
Ian Hickson
2016-04-11 11:10:11 -07:00
parent f43e1dfaff
commit 47f5c6f2e0
19 changed files with 137 additions and 112 deletions

View File

@@ -43,7 +43,7 @@ class SectorConstraints extends Constraints {
bool get isNormalized => minDeltaRadius <= maxDeltaRadius && minDeltaTheta <= maxDeltaTheta;
@override
bool get debugAssertIsNormalized {
bool debugAssertIsValid({ bool isAppliedConstraint: false }) {
assert(isNormalized);
return isNormalized;
}