applyTo method

  1. @override
BouncingScrollPhysics applyTo (ScrollPhysics ancestor)
override

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.

Implementation

@override
BouncingScrollPhysics applyTo(ScrollPhysics ancestor) {
  return BouncingScrollPhysics(parent: buildParent(ancestor));
}