• Ian Hickson's avatar
    Fix some intrinsic constraints contract violations. · 60d9ab7e
    Ian Hickson authored
    RenderBlock wasn't constraining the results.
    RenderPadding wasn't constraining the results (which matters
    especially when the constraints can't fit the padding in the first
    place).
    RenderViewport wasn't constraining the results.
    
    Add a test for the block case.
    
    To catch this kind of thing in the future, add some asserts to
    debugDoesMeetConstraints() that all four intrinsic functions return
    values that are within the constraints.
    
    RenderBlockViewport doesn't support returning intrinsics, so turn off
    the "no intrinsic support" asserts (and return zero) when we're doing
    this new assert.
    
    This new assert screwed up the custom layout classes' tests, so adjust
    those tests to ignore the callbacks invoked from these asserts.
    
    Add to the _debugReportException() method a short summary of the
    descendants of this node. It's important to have this information when
    debugging errors like these intrinsic constraints contract violations
    because often nodes just pass the values through to their child so you
    have to go several steps down to find the actual problem.
    
    Fixes https://github.com/flutter/flutter/issues/1210
    60d9ab7e
custom_multi_child_layout_test.dart 4.68 KB