floating_overlay
1.2.1, released 5 years ago by fmorschel.dev
Widget wrapper that lets a child float, drag and resize on screen.
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.
- loop_page_view
A PageView builder wrapper enabling infinite scrolling in both directions.
50Compare - clickable_list_wheel_view
A wrapper for ListWheelScrollView that allows children to respond to tap events.
50Compare - expandable_reorderable_list
Wrapper around ReorderableListView that adds tree structure, expand/collapse, and reordering.
49Compare - linkable
A Flutter widget that renders clickable links within text.
47Compare
Works with
Packages commonly used together with floating_overlay: ones it builds on, ones built on it, and its own family.
- loggingfloating_overlay depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- equatablefloating_overlay depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- blocfloating_overlay depends on itA Dart library for implementing the BLoC pattern with Cubits and Blocs.