dispatchEndGesture method

void dispatchEndGesture(
  1. double? velocity,
  2. GestureDirection direction
)

Dispatches a new EndGesture determined by the given velocity and direction.

Implementation

void dispatchEndGesture(double? velocity, GestureDirection direction) {
  if (velocity == 0 || velocity == null) {
    endGesture.value = StillGesture(direction);
  } else if (velocity.sign == this.direction.value) {
    endGesture.value = OpeningGesture(velocity);
  } else {
    endGesture.value = ClosingGesture(velocity.abs());
  }

  // If the movement is too fast, the actionPaneConfigurator may still be
  // null. So we have to replay the end gesture when it will not be null.
  if (actionPaneConfigurator == null) {
    _replayEndGesture = true;
  }
}