• Todd Volkert's avatar
    Add ConstrainedLayoutBuilder.updateShouldRebuild() (#136691) · 37da62a6
    Todd Volkert authored
    This method controls whether the builder needs to be called again again even if the layout constraints are the same.
    
    By default, the builder will always be called when the widget is updated because the logic in the callback might have changed. However, there are cases where subclasses of ConstrainedLayoutBuilder know that certain property updates only affect paint and not build. In these cases, we lack a way of expressing that the builder callback is not needed -- and we end up doing superfluous work.
    
    This PR gives subclasses the ability to know exactly when the callback needs to be called and when it can be skipped.
    37da62a6
layout_builder.dart 13.1 KB