createBallisticSimulation method

  1. @override
Simulation? createBallisticSimulation(
  1. ScrollMetrics position,
  2. double velocity
)
override

Implementation

@override
Simulation? createBallisticSimulation(
    ScrollMetrics position, double velocity) {
  final mVelocity =
      hasSecondary && !noMoreLocked && _offset >= actualSecondaryTriggerOffset
          ? secondaryVelocity
          : velocity;
  if (_offset > 0) {
    return BouncingScrollSimulation(
      spring: spring,
      position:
          clamping ? position.maxScrollExtent + _offset : position.pixels,
      velocity: mVelocity,
      leadingExtent: 0,
      trailingExtent: position.maxScrollExtent + overExtent,
      tolerance: _physics.getTolerance(position),
    );
  }
  return null;
}