draggable_panel
5.0.0, released 5 days ago by shodev.live
A floating panel window that can be dragged, spring-snapped, parked off-edge, and tapped to grow.
What it does
Provides a draggable floating panel window for Flutter that spring-snaps to the nearest edge based on momentum, can stash off-screen into a grab tab, and expands in place when tapped. It uses physics-based spring motion and supports gesture control.
AI-written summary of version 5.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a floating picture-in-picture style player or mini-panel over your content.
- You want panels that can snap to edges or stash off-screen into grab tabs.
Skip it when
- Your app relies strictly on standard framework Material widgets without the standalone material_ui package.
- You need a standard bottom sheet or modal dialog instead of a free-roaming floating window.
Strengths
- High-performance motion driven directly inside a RenderBox without widget rebuilds during animation.
- Calculates drop targets and spring physics based on actual momentum and Apple-inspired fluid interfaces.
- Persists resting position as intent rather than raw pixels across layout changes.
Weaknesses
- Requires the standalone material_ui package instead of standard package:flutter/material.dart.
- expandedBuilder runs its layout up front, meaning expensive initialization inside the builder must be avoided.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add draggable_panel and material_ui to pubspec.yaml. Mount the panel via MaterialApp.builder.
MaterialApp(
builder: (context, child) => DraggablePanel(
collapsedBuilder: (context, status) => const Icon(Icons.play_arrow),
expandedBuilder: (context, status) => const MiniPlayer(),
child: child,
),
home: const HomeScreen(),
)Alternatives
Packages that do the same job and could replace draggable_panel.
- springster
Spring animations and physics simulations simplified for Flutter.
76Compare - stupid_simple_sheet
A simple sheet widget for Flutter.
81Compare - elegant_spring_animation
Provides physics-based spring animation curves with customizable bounciness.
47Compare - scroll_drag_detector
A drag gesture detector that handles overscrolling ScrollViews inside of it.
71Compare
Works with
Packages commonly used together with draggable_panel: ones it builds on, ones built on it, and its own family.