Skip to content

Commit

Permalink
Merge pull request letsar#434 from Popiron/fix/slidable_twitching_aft…
Browse files Browse the repository at this point in the history
…er_swipe

fix: Slidable twitching after swiping into disabled pane
  • Loading branch information
letsar authored Jul 11, 2024
2 parents 3f0010f + dcbd633 commit be008a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit be008a4

Please sign in to comment.