Skip to content
pubscout

flutter_portal

1.1.4, released 3 years ago by cjycode.com

Declarative replacement for Flutter's Overlay and OverlayEntry with built-in alignment.

WASM-ready
$ flutter pub add flutter_portal
Source repository

What it does

Provides a declarative way to show floating overlays like tooltips, menus, and dialogs directly inside the widget tree. It handles target alignment, keeps intuitive BuildContext access for themes and providers, and supports easy state restoration.

AI-written summary of version 1.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to show contextual menus, tooltips, or dropdowns declaratively
  • You want overlay entries to inherit the correct Theme and providers from their intuitive parent context

Skip it when

  • You are satisfied with using the imperative built-in Overlay and OverlayEntry classes

Strengths

  • Declarative API integrated into the normal widget tree
  • Intuitive parent context for theme and provider access
  • Built-in alignment support via anchors like Aligned and Filled

Weaknesses

  • Requires wrapping the app or route with a Portal widget

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Add the Portal widget near the root of the app, such as above MaterialApp.

PortalTarget(
  portalFollower: MyAwesomeOverlayWidget(),
  anchor: Aligned.center,
  child: MyChildWidget(),
)

Alternatives

Packages that do the same job and could replace flutter_portal.

Works with

Packages commonly used together with flutter_portal: ones it builds on, ones built on it, and its own family.