Skip to content

Commit be008a4

Browse files
authored
Merge pull request #434 from Popiron/fix/slidable_twitching_after_swipe
fix: Slidable twitching after swiping into disabled pane
2 parents 3f0010f + dcbd633 commit be008a4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/src/controller.dart

+15
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,21 @@ class SlidableController {
225225
/// Dispatches a new [EndGesture] determined by the given [velocity] and
226226
/// [direction].
227227
void dispatchEndGesture(double? velocity, GestureDirection direction) {
228+
final isScrollingIntoDisabledEndActionPane = enableStartActionPane &&
229+
!enableEndActionPane &&
230+
this.direction.value == 0 &&
231+
direction == GestureDirection.closing;
232+
final isScrollingIntoDisabledStartActionPane = !enableStartActionPane &&
233+
enableEndActionPane &&
234+
this.direction.value == 0 &&
235+
direction == GestureDirection.opening;
236+
final isScrollingIntoDisabledPane = isScrollingIntoDisabledEndActionPane ||
237+
isScrollingIntoDisabledStartActionPane;
238+
239+
if (isScrollingIntoDisabledPane) {
240+
return;
241+
}
242+
228243
if (velocity == 0 || velocity == null) {
229244
endGesture.value = StillGesture(direction);
230245
} else if (velocity.sign == this.direction.value) {

0 commit comments

Comments
 (0)