ScrollSimulation({double position, double velocity, double leadingExtent, double trailingExtent, SpringDescription spring, double drag, TargetPlatform platform })

Creates a ScrollSimulation with the given parameters.

The position and velocity arguments must use the same units as will be expected from the x and dx methods respectively.

The leading and trailing extents must use the unit of length, the same unit as used for the position argument and as expected from the x method.

The units used with the provided SpringDescription must similarly be consistent with the other arguments.

The final argument is the coefficient of friction, which is unitless.

Source

ScrollSimulation({
  double position,
  double velocity,
  double leadingExtent,
  double trailingExtent,
  SpringDescription spring,
  double drag,
  TargetPlatform platform,
}) : _leadingExtent = leadingExtent,
     _trailingExtent = trailingExtent,
     _spring = spring ?? _kScrollSpring,
     _drag = drag ?? _kDrag,
     _platform = platform {
  assert(_leadingExtent != null);
  assert(_trailingExtent != null);
  assert(_spring != null);
  _chooseSimulation(position, velocity, 0.0);
}