Skip to content
pubscout

flutter_anchor

0.0.13, released 12 months ago by degenk.com

Core widgets for connecting floating overlays and tooltips to anchor widgets.

WASM-ready
$ flutter pub add flutter_anchor
Source repository

What it does

Provides foundational widgets like Anchor and RawAnchor for positioning floating overlays relative to an anchor widget. It supports trigger modes like tap, hover, focus, and manual triggers with customizable positioning middlewares.

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

Use it when

  • You need custom tooltips, popovers, or context menus with precise positioning.
  • You want trigger-based overlays for focus, hover, or taps without pre-styled containers.

Skip it when

  • You want pre-styled UI components out of the box (use anchor_ui instead).
  • You cannot tolerate a one-frame measurement delay on first overlay appearance without explicit sizing.

Strengths

  • Flexible positioning pipeline using customizable middlewares like flip and shift.
  • Multiple trigger modes including tap, hover, focus, and manual.

Weaknesses

  • No default styling or pre-styled containers are provided.
  • First-time overlay appearance may have a one-frame measurement delay unless sizes are provided in advance.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
final _controller = AnchorController();

Anchor(
  controller: _controller,
  triggerMode: const AnchorTriggerMode.manual(),
  placement: Placement.bottomStart,
  overlayBuilder: (context) => Container(padding: const EdgeInsets.all(8), child: const Text('Menu Content')),
  child: IconButton(
    icon: const Icon(Icons.menu),
    onPressed: () => _controller.toggle(),
  ),
)

Alternatives

Packages that do the same job and could replace flutter_anchor.

  • popover

    Displays a transient iOS-style popover view above other content pointing at a control.

  • arrow_popup

    A popup bubble with a pointing arrow for tooltips, popovers, menus and dropdowns.

  • aligned_tooltip

    A flexible tooltip widget that aligns to its target with automatic fallback positioning.

  • super_context_menu

    Context menu widget supporting native menus on platforms and drag & drop transitions on mobile.

Works with

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