addPixelDelta method Null safety

void addPixelDelta(
  1. double delta,
  2. BuildContext? context
)

The scroll position gets inputs in terms of pixels, but the extent is expected to be expressed as a number between 0..1.

Implementation

void addPixelDelta(double delta, BuildContext? context) {
  if (availablePixels == 0) {
    return;
  }
  currentExtent += delta / availablePixels * maxExtent;
  FlexibleDraggableScrollableNotification(
    minExtent: minExtent,
    maxExtent: maxExtent,
    extent: currentExtent,
    initialExtent: initialExtent,
    context: context,
  ).dispatch(context);
}