applyTo method

ScrollPhysics applyTo (ScrollPhysics ancestor)

If parent is null then return a ScrollPhysics with the same runtimeType where the parent has been replaced with the ancestor.

If this scroll physics object already has a parent, then this method is applied recursively and ancestor will appear at the end of the existing chain of parents.

The returned object will combine some of the behaviors from this ScrollPhysics instance and some of the behaviors from ancestor.

See also:

  • buildParent, a utility method that's often used to define applyTo methods for ScrollPhysics subclasses.


ScrollPhysics applyTo(ScrollPhysics ancestor) {
  return ScrollPhysics(parent: buildParent(ancestor));