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
dependencies: flutter_list_drag_and_drop: "^0.1.6"
- 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.
A new Flutter example of the list drag& drop.
Getting Started #
For help getting started with Flutter, view our online documentation.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: flutter_list_drag_and_drop: ^0.1.6
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub 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';
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]
We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.5.0
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.2
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
lib/drag_and_drop_list.dart. (-1.99 points)
lib/drag_and_drop_list.dart reported 4 hints:
line 191 col 16: The value of the local variable 'end' isn't used.
line 332 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: DraggableListItem.myKey, DraggableListItem.delegate
line 336 col 16: The value of the field '_kScrollThreashhold' isn't used.
line 400 col 38: Name non-constant identifiers using lowerCamelCase.
flutter format to format
Maintenance issues and suggestions
Provide a file named
CHANGELOG.md. (-20 points)
Changelog entries help developers follow the progress of your package. See the example generated by