layout method

Size layout()

Override this method to lay out children and return the final size of the boxy.

This method should call BoxyChild.layout for each child. It should also specify the position of each child with BoxyChild.position.

Unlike MultiChildLayoutDelegate the resulting size can depend on both child layouts and incoming constraints.

For BoxyDelegates, the default behavior is to pass incoming constraints to children and size to the largest dimensions, otherwise it returns the smallest size.

During a dry layout this method is called like normal, but methods like BoxyChild.position and BoxyChild.layout no longer not affect their actual orientation. Additionally, the inflate method will throw CannotInflateError if called during a dry layout.

Implementation

Size layout() => constraints.smallest;