Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c7c3597
drag handle to own widget
philip-brink Mar 30, 2021
72bfb0b
null safety
philip-brink Mar 30, 2021
69f9a6c
version bump
philip-brink Mar 30, 2021
524711c
Merge pull request #32 from philip-brink/Refactors
philip-brink Mar 30, 2021
d0f8e8b
analyze fixes
philip-brink Mar 30, 2021
2ca07ee
Fix crash when no itemHandleSpecified, fix wrong handle usage for ite…
vbuberen Apr 2, 2021
ff24bdc
Merge pull request #35 from vbuberen/fix/list_item_null_crash
philip-brink Apr 2, 2021
5ed9399
update version
philip-brink Apr 2, 2021
4be8019
Scroll in the correct direction when text is rtl
philip-brink Apr 15, 2021
be427d4
Scroll in the correct direction when text is rtl
philip-brink Apr 15, 2021
d9a7dac
custom feedback
svoza10 Apr 20, 2021
7a7d120
feedback optional
svoza10 Apr 20, 2021
4db995d
Merge pull request #37 from svoza10/master
philip-brink Apr 20, 2021
c60d35d
Bump version
philip-brink Apr 20, 2021
16f08b0
Add basic workflow to run quality checks on Github Actions
vbuberen Apr 25, 2021
61abf3d
Fix workflow file extension
vbuberen Apr 25, 2021
54e0fa9
Apply lastListTargetSize in Horizontal mode
locnguyen154 Sep 1, 2021
a6280c1
Add ability to remove top padding
aliasgarlabs Sep 6, 2021
c311dd1
Merge pull request #48 from nvloc120/Issue_lastListTargetSize_dose_no…
philip-brink Oct 21, 2021
fd995b2
Fix last list target for horizontal lists
philip-brink Oct 21, 2021
001f47a
Merge pull request #38 from vbuberen/feature/actions
philip-brink Oct 21, 2021
943d586
Merge pull request #51 from aliasgarlabs/master
philip-brink Oct 21, 2021
af0cbe3
Add ability to remove top padding when there is a widget before the D…
philip-brink Oct 21, 2021
bdd1fa5
Remove pubspec.lock
philip-brink Oct 21, 2021
3bc9ae5
Replace deprecated elements
philip-brink Oct 21, 2021
f085bf4
(Flutter 3) remove optional instance Type for SchedulerBinding.instance
mauriceraguseinit May 20, 2022
2b9660e
code formatting
mauriceraguseinit May 20, 2022
bb224b1
add environment requirements
mauriceraguseinit Jun 22, 2022
2b78b81
Merge pull request #75 from init-Mobile/master
philip-brink Aug 4, 2022
e450da3
Update example project
philip-brink Aug 4, 2022
76ff8ef
Make analyzer happy
philip-brink Aug 4, 2022
7909991
feat: add key to `DragAndDropItem` and `DragAndDropList`
saileshbro Sep 28, 2023
04715d1
fix to compatible with Flutter 3.22.0 version
dmitry-comet May 15, 2024
5d8922f
Merge pull request #98 from dmitry-comet/master
philip-brink Jun 11, 2024
fd7e301
update version to 0.4.0
philip-brink Jun 11, 2024
cb96762
update SDK constraint to <4.0.0
philip-brink Jun 11, 2024
772d434
add linter and linting analysis options
philip-brink Jun 11, 2024
c86481a
apply dart fix changes
philip-brink Jun 11, 2024
a08f621
Merge remote-tracking branch 'upstream/master'
saileshbro Jun 12, 2024
39fa614
Merge pull request #94 from saileshbro/master
philip-brink Jun 12, 2024
aa0d15d
Update gradle to imperative plugins
philip-brink Jun 12, 2024
4adca04
apply dart fix changes
philip-brink Jun 12, 2024
d9bcb9e
Merge branch 'misc_updates'
philip-brink Jun 12, 2024
655daba
update version to 0.4.1
philip-brink Jun 12, 2024
a30a20a
Remove outdated info
philip-brink Jun 13, 2024
1e19ba2
Make flutter analyze happy
philip-brink Jun 13, 2024
dc271f7
Update example web build
philip-brink Jun 13, 2024
be8b222
Add key getter to drag and drop list interface
juancdominici Oct 7, 2024
734cb79
Update example gradle
philip-brink Nov 26, 2024
a202c67
Merge pull request #106 from juancdominici/key-getter-in-list
philip-brink Nov 26, 2024
b1d2e60
Merge remote-tracking branch 'origin/master'
philip-brink Nov 26, 2024
0415ce8
Bump version
philip-brink Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/quality_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Quality control checks

on:
push:
branches:
- master
pull_request:
branches:
- '*'
workflow_dispatch:
branches:
- '*'

jobs:
analyze:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v2

- uses: subosito/flutter-action@v1
with:
channel: 'stable'

- run: flutter pub get

- run: flutter analyze

test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v2

- uses: subosito/flutter-action@v1
with:
channel: 'stable'

- run: flutter pub get

- run: flutter test
47 changes: 45 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
# Changelog

[0.4.2] - 26 November 2024

* Add key getter to drag and drop list interface (thanks [@juancdominici](https://github.com/juancdominici))

[0.4.1] - 12 June 2024

* Add key to DragAndDropItem and DragAndDropList (thanks [@saileshbro](https://github.com/saileshbro))

[0.4.0] - 11 June 2024

* Update to be compatible with Flutter 3.22.0 (thanks [@dmitry-comet](https://github.com/dmitry-comet))

[0.3.3] - 4 August 2022

* Update to flutter 3 (thanks [@mauriceraguseinit](https://github.com/mauriceraguseinit))

[0.3.2+2] - 21 October 2021

* Replace flutter deprecated elements

[0.3.2+1] - 21 October 2021

* Fix last list target for horizontal lists (thanks [@nvloc120](https://github.com/nvloc120)).
* Add ability to remove top padding when there is a widget before the DragAndDropLists (See [flutter/flutter#14842](https://github.com/flutter/flutter/issues/14842), thanks [@aliasgarlabs](https://github.com/aliasgarlabs))

## [0.3.2] - 20 April 2021

* Add optional feedback widget to items (thanks [@svoza10](https://github.com/svoza10)).

## [0.3.1] - 15 April 2021

* Fix scrolling in wrong direction when text direction is right-to-left.
* Fix drag-and-drop feedback widget alignment when text direction is right-to-left.

## [0.3.0+1] - 2 April 2021

* Fix null crash and wrong drag handle used (thanks [@vbuberen](https://github.com/vbuberen)).

## [0.3.0] - 30 March 2021

* DragHandle moved to own widget. To create any drag handle, use the new properties `listDragHandle` and `itemDragHandle` in `DragAndDropLists`.
* Support null safety, see [details on migration](https://dart.dev/null-safety/migration-guide).

## [0.2.10] - 14 December 2020

* Bug fix where `listDecorationWhileDragging` wasn't always being applied
* Allow DragAndDropLists to be contained in an external ListView when `disableScrolling` is set to `true`
* Bug fix where `listDecorationWhileDragging` wasn't always being applied.
* Allow DragAndDropLists to be contained in an external ListView when `disableScrolling` is set to `true`.

## [0.2.9+2] - 17 November 2020

Expand Down
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# drag\_and\_drop\_lists
Two-level drag and drop reorderable lists.

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/pbpbpb)

## Features
- Reorder elements between multiple lists
- Reorder lists
Expand All @@ -13,33 +15,22 @@ Two-level drag and drop reorderable lists.
- Easy to extend with custom layouts

<p>
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/basic.gif" width="180" title="Basic">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/expansion_tiles.gif" width="180" title="Expansion Tiles">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/drag_handle.gif" width="180" title="Drag Handle">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/drag_into_list.gif" width="180" title="Drag Into Lists">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/horizontal.gif" width="180" title="Horizontal">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/list_tiles.gif" width="180" title="List Tiles">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/slivers.gif" width="180" title="Slivers">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/basic.gif" width="180" title="Basic" alt="Basic list">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/expansion_tiles.gif" width="180" title="Expansion Tiles" alt="Drag and drop expansion tiles">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/drag_handle.gif" width="180" title="Drag Handle" alt="Drag and drop using drag handles">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/drag_into_list.gif" width="180" title="Drag Into Lists" alt="Drag and drop new lists and new items">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/horizontal.gif" width="180" title="Horizontal" alt="Drag and drop horizontal lists">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/list_tiles.gif" width="180" title="List Tiles" alt="Drag and drop list tiles">
<img src="https://raw.githubusercontent.com/philip-brink/DragAndDropLists/master/readme_images/slivers.gif" width="180" title="Slivers" alt="Drag and drop lists using slivers">
</p>

## Known Issues
There is currently (as of flutter v. 1.24.0-1.0.pre) an issue only on web where dragging an item with some descendant that includes an InkWell widget with an onTap method will throw an exception. This includes having a ListTile with an onTap method defined.

This seems to be resolved by using a GestureDetector and its onTap method instead of the InkWell.

See the following issues:
* [#14](https://github.com/philip-brink/DragAndDropLists/issues/14)
* [Flutter #69774](https://github.com/flutter/flutter/issues/69774)
* [Flutter #67044](https://github.com/flutter/flutter/issues/67044)
* [Flutter #66887](https://github.com/flutter/flutter/issues/66887)

## Usage
To use this plugin, add `drag_and_drop_lists` as a [dependency in your pubspec.yaml file.](https://flutter.dev/docs/development/packages-and-plugins/using-packages)
For example:

```
dependencies:
drag_and_drop_lists: ^0.2.1
drag_and_drop_lists: ^0.4.0
```

Now in your Dart code, you can use: `import 'package:drag_and_drop_lists/drag_and_drop_lists.dart';`
Expand Down
28 changes: 28 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/tools/linter-rules.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/tools/analysis
8 changes: 6 additions & 2 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
Expand All @@ -22,6 +23,7 @@

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
Expand All @@ -39,5 +41,7 @@ app.*.symbols
# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
24 changes: 22 additions & 2 deletions example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@
# This file should be version controlled and should not be manually edited.

version:
revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe
channel: stable
revision: "nixpkgs000000000000000000000000000000000"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: nixpkgs000000000000000000000000000000000
base_revision: nixpkgs000000000000000000000000000000000
- platform: web
create_revision: nixpkgs000000000000000000000000000000000
base_revision: nixpkgs000000000000000000000000000000000

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
8 changes: 4 additions & 4 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
29 changes: 29 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
6 changes: 6 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
44 changes: 23 additions & 21 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,26 +22,31 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
namespace = "com.example.example"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
disable 'InvalidPackage'
kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 28
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -56,8 +62,4 @@ android {

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
}
6 changes: 3 additions & 3 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Loading