From dcbd63348a2ef6083bf3ec1a8afda2e6c4cc6e0d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 6 Jul 2023 17:28:31 +0300 Subject: [PATCH] add skipping scrolling into disabled pane --- lib/src/controller.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/src/controller.dart b/lib/src/controller.dart index 2ab989a4..c13b9708 100644 --- a/lib/src/controller.dart +++ b/lib/src/controller.dart @@ -225,6 +225,21 @@ class SlidableController { /// Dispatches a new [EndGesture] determined by the given [velocity] and /// [direction]. void dispatchEndGesture(double? velocity, GestureDirection direction) { + final isScrollingIntoDisabledEndActionPane = enableStartActionPane && + !enableEndActionPane && + this.direction.value == 0 && + direction == GestureDirection.closing; + final isScrollingIntoDisabledStartActionPane = !enableStartActionPane && + enableEndActionPane && + this.direction.value == 0 && + direction == GestureDirection.opening; + final isScrollingIntoDisabledPane = isScrollingIntoDisabledEndActionPane || + isScrollingIntoDisabledStartActionPane; + + if (isScrollingIntoDisabledPane) { + return; + } + if (velocity == 0 || velocity == null) { endGesture.value = StillGesture(direction); } else if (velocity.sign == this.direction.value) {