ScrollPosition constructor
Creates an object that determines which portion of the content is visible in a scroll view.
The physics
, context
, and keepScrollOffset
parameters must not be null.
Implementation
ScrollPosition({
@required this.physics,
@required this.context,
this.keepScrollOffset = true,
ScrollPosition oldPosition,
this.debugLabel,
}) : assert(physics != null),
assert(context != null),
assert(context.vsync != null),
assert(keepScrollOffset != null) {
if (oldPosition != null)
absorb(oldPosition);
if (keepScrollOffset)
restoreScrollOffset();
}