Skip to content
pubscout

dnd

2.0.1, released 5 years ago by jakobservices.ch

Drag and Drop for Dart web apps with mouse and touch support.

$ flutter pub add dnd
Source repository

What it does

Provides Draggable and Dropzone classes to enable drag-and-drop interactions in Dart web applications. Supports mouse and touch input, custom drag avatars, and shadow DOM event retargeting.

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

Use it when

  • You are building a Dart web application that needs drag-and-drop capabilities.
  • You need touch support alongside mouse dragging for mobile web browsers.

Skip it when

  • You are building a mobile or desktop Flutter app (this package is for Dart web apps using HTML elements).
  • You are looking for standard Flutter widget tree drag-and-drop utilities (like Draggable in Flutter SDK).

Strengths

  • Supports both mouse and touch interactions.
  • Configurable avatar handlers for visual drag feedback.
  • Support for Shadow DOM and Web Components via retargeting.

Weaknesses

  • Limited strictly to Dart web applications using HTML elements.
  • Not applicable to native Flutter mobile/desktop apps.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Instantiate Draggable and Dropzone classes passing HTML elements or query selectors.

Draggable draggable = Draggable(querySelectorAll('.draggable'), avatarHandler: AvatarHandler.clone());
Dropzone dropzone = Dropzone(querySelector('.dropzone'));

Alternatives

Packages that do the same job and could replace dnd.