onDragUpdate method

void onDragUpdate(
  1. DragUpdateDetails details
)

when dragging the SlidablePanel, this method will be called each update of the ratio would trigger the RenderSlidable to re-layout

Implementation

void onDragUpdate(DragUpdateDetails details) {
  assert(layoutSize != null);
  final shift = switch (layoutSize!.axis) {
    Axis.horizontal => details.delta.dx,
    Axis.vertical => details.delta.dy,
  };
  _forwarding = _dragExtent * shift > 0;
  _dragExtent += shift;
  // print("forwarding: $_forwarding, direction: $direction");

  final newRatio = layoutSize!
      .getRatio(_dragExtent)
      ?.clamp(_lowerBound, _upperBound)
      .toDouble();

  if (newRatio != null && newRatio != ratio) {
    _animationValue = newRatio;
  }
}