flutter_list_drag_and_drop 0.1.5

  • README.md
  • Example
  • Installing
  • Versions
  • 89


The Flutter team has also pushed this feature to the framework, https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/reorderable_list.dart

A new Flutter package which handles all aspects of drag and drop inside a listView.

In your pubspec.yaml

  flutter_list_drag_and_drop: "^0.1.3"


Demo 1


  • When dragging an item to the top/ bottom the list scroll accordingly
  • Works with different sized items
  • material like behaviour

Take a look at the example folder for info on how to use

If you encounter feel free to open an issue. Pull request are also welcome.


import 'package:flutter/material.dart';
import 'package:flutter_list_drag_and_drop/drag_and_drop_list.dart';

void main() {
  runApp(new TestApp());

class TestApp extends StatelessWidget {
  TestApp({Key key});

  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
          primarySwatch: Colors.blue, primaryColor: new Color(0xffd05c6b)),
      home: new MyHomePage(
        title: 'Flutter Demo Home Page',
        key: key,

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  MyHomePageState createState() => new MyHomePageState();

class MyHomePageState extends State<MyHomePage> {
  List<String> items = [
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      body: new DragAndDropList<String>(
        itemBuilder: (BuildContext context, item) {
          return new SizedBox(
            child: new Card(
              child: new ListTile(
                title: new Text(item),
        onDragFinish: (before, after) {
          String data = items[before];
          items.insert(after, data);
        canBeDraggedTo: (one, two) => true,
        dragElevation: 8.0,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_list_drag_and_drop: ^0.1.5

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_list_drag_and_drop/drag_and_drop_list.dart';
import 'package:flutter_list_drag_and_drop/my_draggable.dart';
Version Uploaded Documentation Archive
0.1.5 Aug 31, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.5 Download flutter_list_drag_and_drop 0.1.5 archive
0.1.4 Aug 6, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.4 Download flutter_list_drag_and_drop 0.1.4 archive
0.1.3 May 7, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.3 Download flutter_list_drag_and_drop 0.1.3 archive
0.1.2 May 1, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.2 Download flutter_list_drag_and_drop 0.1.2 archive
0.1.1 Apr 26, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.1 Download flutter_list_drag_and_drop 0.1.1 archive
0.1.0 Apr 26, 2018 Go to the documentation of flutter_list_drag_and_drop 0.1.0 Download flutter_list_drag_and_drop 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Issues and suggestions

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

Fix lib/drag_and_drop_list.dart.

Analysis of lib/drag_and_drop_list.dart reported 3 hints:

line 196 col 16: The value of the local variable 'end' isn't used.

line 339 col 7: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final).

line 343 col 16: The value of the field '_kScrollThreashhold' isn't used.

Format lib/my_draggable.dart.

Run flutter format to format lib/my_draggable.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
cupertino_icons ^0.1.0 0.1.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies