Simple sortable DOM elements in Dart using HTML5 drag and drop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitattributes
.gitignore
LICENSE
README.md
pubspec.yaml

README.md

Assortment

Simple sortable DOM elements in Dart using HTML5 drag and drop

Usage

To use this library in your code :

  • add a dependency in your pubspec.yaml :
dependencies:
  assortment: ">=0.1.0 <1.0.0"
  • add import in your dart code :
import 'package:assortment/assortment.dart';
  • create an Assortment within an element
var a = new Assortment(querySelector('#sortable-container'));
  • add children to the Assortment
a.addElements(querySelectorAll('#sortable-container .sortable-entry'));
  • rearrange elements by dragging and dropping

  • listen for events to run code during drags

a.onDragEnter.listen((AssortmentEvent event) {
  // update model
}