draggable_widget
2.0.0, released 5 years ago by theadar.xyz
A Flutter widget that can be dragged around the screen.
What it does
Provides a single widget that can be moved by the user via drag gestures. It offers customizable initial position, margins, shadows and a controller to programmatically show, hide or move it.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a floating button that the user can reposition
- You want a draggable UI element without writing custom gesture code
- You need a simple, customizable drag‑and‑drop widget that works on mobile and web
Skip it when
- Complex multi‑item drag‑and‑drop scenarios
- You require physics‑based motion or snapping beyond basic anchoring
- You need a full drag‑and‑drop framework with data transfer
Strengths
- Highly customizable (shadows, scaling, margins)
- Supports all Flutter platforms including web
- Provides a controller for programmatic control
Weaknesses
- Limited to a single widget; not a full drag‑and‑drop system
- No built‑in physics or snapping beyond four anchor points
- Customization limited to provided properties
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Stack(
children:[
DraggableWidget(
bottomMargin:80,
topMargin:80,
intialVisibility:true,
horizontalSpace:20,
shadowBorderRadius:50,
child:Container(height:100,width:100,decoration:BoxDecoration(shape:BoxShape.circle,color:Colors.blue)),
initialPosition:AnchoringPosition.bottomLeft,
dragController:dragController,
),
],
)Alternatives
Packages that do the same job and could replace draggable_widget.
- draggable_fab
A wrapper widget that makes a Floating Action Button draggable to screen edges.
44Compare - ftoast
Simple, customizable in-app toast notifications for Flutter.
65Compare - floating_chat_button
A draggable floating chat icon button that displays messages on the screen.
41Compare - interactive_bottom_sheet
A customizable interactive bottom sheet that lets users interact with the screen behind it.
65Compare