To perform layout, Flutter walks the render tree in a depth-first traversal and
passes down size constraints from parent to child. In determining its size,
the child must respect the constraints given to it by its parent. Children
respond by passing up a size to their parent object within the constraints
the parent established.

At the end of this single walk through the tree, every object has a defined size
within its parent’s constraints and is ready to be painted by calling the
paint()
method.

The box constraint model is very powerful as a way to layout objects in O(n)
time:

Parents can dictate the size of a child object by setting maximum and minimum
constraints to the same value. For example, the topmost render object in a
phone app constrains its child to be the size of the screen. (Children can
choose how to use that space. For example, they might just center what they
want to render within the dictated constraints.)