There are some layouts that are expressible in our system, but nonsensical, that we want to watch out for. When we can we'd like to log a warning, and if possible fix the API to make nonsensical layouts harder or impossible to layout. But warnings are a good first step.
Here are a few:
A "minimum" constraint of infinity makes no sense.
A child returning infinity as its size makes no sense (infinity should only be passed down to children, never bubbled back up). I believe this can currently happen with a flexible widget inside an align widget, for instance.
As far as I know, passing an infinite width to an align widget that's trying to center horizontally makes no sense, and same for height / vertical. However, an align widget could center something in one axis and still be fine with max infinity in the other — centering in a vertical scroll comes to mind.
If you try to "expand" a SizedBox inside of infinity that should be bad.
When possible, warnings can be added to the BoxConstraints method debug_check. constrain might also be a good spot. Not sure if that will work for all of these.
There are some layouts that are expressible in our system, but nonsensical, that we want to watch out for. When we can we'd like to log a warning, and if possible fix the API to make nonsensical layouts harder or impossible to layout. But warnings are a good first step.
Here are a few:
When possible, warnings can be added to the BoxConstraints method
debug_check
.constrain
might also be a good spot. Not sure if that will work for all of these.If you know of any other gotchas please add them!