Skip to content
pubscout

floating_overlay

1.2.1, released 5 years ago by fmorschel.dev

Widget wrapper that lets a child float, drag and resize on screen.

WASM-ready
$ flutter pub add floating_overlay
Source repository

What it does

It provides a FloatingOverlay widget that can be positioned anywhere on the screen and resized by the user. The overlay can be shown or hidden via a controller and supports optional constraints and padding.

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

Use it when

  • You need a movable, resizable floating widget on top of your UI
  • You want to keep the overlay state across route pushes and pops
  • You need a simple, declarative API without external dependencies

Skip it when

  • You require complex gesture handling beyond drag and resize
  • You need a persistent overlay that survives app restarts or backgrounding

Strengths

  • Easy to integrate with a simple controller API
  • Supports both absolute and relative sizing
  • Handles route changes automatically via RouteObserver
  • Provides stream of overlay data for reactive UI

Weaknesses

  • Only works on Flutter, no native platform APIs
  • Limited to basic drag/resize gestures
  • No built‑in persistence or advanced animation options

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3
final controller = FloatingOverlayController.absoluteSize(
  maxSize: const Size(200, 200),
  minSize: const Size(100, 100),
  start: Offset.zero,
  padding: const EdgeInsets.all(20.0),
  constrained: true,
);

FloatingOverlay(
  controller: controller,
  floatingChild: SizedBox.square(
    dimension: 100.0,
    child: Container(
      decoration: BoxDecoration(
        color: Theme.of(context).primaryColor,
        border: Border.all(
          color: Colors.black,
          width: 5.0,
        ),
      ),
    ),
  ),
  child: Container(),
);

Alternatives

Packages that do the same job and could replace floating_overlay.

Works with

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