Skip to content

Expose OverlayPortal's declarative API #136769

@LongCatIsLooong

Description

@LongCatIsLooong

Currently OverlayPortal's declarative API is hidden behind the imperative OverlayPortalController.open() and OverlayPortalController.close() API. We couldn't find a declarative API that we could all agree on to describe the z-order of an Overlay's render children. Under the hood, the OverlayPortalController.open() method uses the current time as the z-order value, such that the last controller to call open gets to show its overlay child at the top.

One example where the declarative API becomes desirable is for implementing the menu system. All open menus should dismiss when the containing window changes size. Window resizing is propagated in the widget tree via MediaQuery changes, but OverlayPortalController.open() and OverlayPortalController.close() can't be called during widget tree rebuild because they both call setState.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions