Skip to content
pubscout

modals

1.0.0+1, released 4 years ago by klasu.dev

Flutter package to simplify overlay and modal management.

WASM-ready
$ flutter pub add modals
Source repository

What it does

Simplifies creating and positioning overlays, context menus, and modals using absolute positions, alignments, or anchors next to other widgets. Provides options for priority ordering, barrier dismissal, and route-aware automatic removal.

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

Use it when

  • You need to show custom overlays, dropdowns, or context menus anchored to specific widgets.
  • You want programmatic control over showing and removing multiple modals by tag or ID.

Skip it when

  • You are looking for standard platform dialogs or bottom sheets that are already built into Flutter's Material library.
  • You prefer fully declarative UI-driven overlay states.

Strengths

  • Supports multiple positioning modes (positioned, aligned, anchored).
  • Allows prioritizing modal visibility using tags.
  • Includes built-in support for route-aware automatic removal.

Weaknesses

  • Requires registering a custom navigator observer for route-aware features.
  • Relies on imperative function calls rather than a fully declarative approach.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Add modalsRouteObserver to your MaterialApp navigatorObservers if you want route-aware modal dismissal.

showModal(ModalEntry.aligned(context,
    tag: 'containerModal',
    alignment: Alignment.center,
    child: Container(
      color: Colors.red,
      width: 50,
      height: 50,
    )));

Alternatives

Packages that do the same job and could replace modals.