LayoutBuilder optimization

Summary

Context

Description of change

Migration guide

Timeline

References

Summary

This guide explains how to migrate Flutter applications after the LayoutBuilder
optimization.

Context

LayoutBuilder and SliverLayoutBuilder call the builder function
more often than necessary to fulfill their primary goal of allowing apps to adapt
their widget structure to parent layout constraints. This has led to less
efficient and jankier applications because widgets are rebuilt unnecessarily.

This transitively affects OrientationBuilder as well.

In order to improve app performance the LayoutBuilder optimization was made,
which results in calling the builder function less often.

Apps that rely on this function to be called with a certain frequency may break.
The app may exhibit some combination of the following symptoms: