canSizeOverlay property

bool canSizeOverlay
final

Whether the content of this OverlayEntry can be used to size the Overlay.

In most situations the overlay sizes itself based on its incoming constraints to be as large as possible. However, if that would result in an infinite size, it has to rely on one of its children to size itself. In this situation, the overlay will consult the topmost non-Positioned overlay entry that has this property set to true, lay it out with the incoming BoxConstraints of the overlay, and force all other non-Positioned overlay entries to have the same size. The Positioned entries are laid out as usual based on the calculated size of the overlay.

Overlay entries that set this to true must be able to handle unconstrained BoxConstraints.

Setting this to true has no effect if the overlay entry uses a Positioned widget to position itself in the overlay.

Implementation

final bool canSizeOverlay;