• Hixie's avatar
    HomogeneousViewport support for Theme.of() · d45bf145
    Hixie authored
    Previously, RenderObjectElements didn't support being marked dirty. This
    is fine, except for MixedViewport and HomogeneousViewport, which have
    builder functions to which they hand themselves as a BuildContext. If
    those builder functions call, e.g., Theme.of(), then when the theme
    changes, the Inherited logic tries to tell the RenderObjectElement
    object that its dependencies changed and that doesn't go down well.
    
    This patch fixes this by making RenderObjectElement a BuildableElement,
    and making MixedViewport and HomogeneousViewport hook into that to
    rebuild themselves appropriately.
    
    Also, this was only found at all because ThemeData didn't implement
    operator==, so we were aggressively marking the entire tree dirty all
    the time. That's fixed here too.
    
    Also, I changed card_collection.dart to have more features to make this
    easier to test. This found bugs #1524, #1522, #1528, #1529, #1530, #1531.
    d45bf145
mixed_viewport.dart 23.6 KB