LayoutBuilder
The LayoutBuilder widget provides a builder property of the LayoutWidgetBuilder type. Although it's similar to the Builder widget, LayoutWidgetBuilder comes with additional info about the parent widget size inside a BoxConstraints value.
With this information, the build method can be changed according to the available space. So, in different devices there will be a different amount of space available in the root widget of the tree, which may limit its children's sizes as well. By using this widget, we can choose whether or not to show some parts of the layout.
This widget is dependent on the parent widget's size, so it gets rebuilt every time the size changes. This can occur in different ways on mobile devices. The simplest ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access