Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiDragGestureRecognizer patch #39

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 11 additions & 9 deletions lib/flutter_reorderable_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ class ReorderableListener extends StatelessWidget {
@protected
MultiDragGestureRecognizer createRecognizer({
required Object? debugOwner,
PointerDeviceKind? kind,
}) {
return _Recognizer(
debugOwner: debugOwner,
kind: kind,
);
}

Expand All @@ -144,10 +142,13 @@ class ReorderableListener extends StatelessWidget {
final listState = _ReorderableListState.of(context)!;
if (listState.dragging == null) {
listState._startDragging(
key: state!.key,
event: event!,
scrollable: scrollable,
recognizer: createRecognizer(debugOwner: this, kind: event.kind));
key: state!.key,
event: event!,
scrollable: scrollable,
recognizer: createRecognizer(
debugOwner: this,
),
);
}
}
}
Expand Down Expand Up @@ -761,11 +762,12 @@ class _VerticalPointerState extends MultiDragPointerState {
// VerticalDragGestureRecognizer waits for kTouchSlop to be reached; We don't want that
// when reordering items
//
class _Recognizer extends MultiDragGestureRecognizer<_VerticalPointerState> {
class _Recognizer extends MultiDragGestureRecognizer {
_Recognizer({
required Object? debugOwner,
PointerDeviceKind? kind,
}) : super(debugOwner: debugOwner, kind: kind);
}) : super(
debugOwner: debugOwner,
);

@override
_VerticalPointerState createNewPointerState(PointerDownEvent event) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_reorderable_list
description: Reorderable list for flutter.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/knopp/flutter_reorderable_list

environment:
Expand Down