physics property

ScrollPhysics? physics
final

How the widgets should respond to user input.

For example, determines how the widget continues to animate after the user stops dragging the scroll view.

Defaults to matching platform conventions via the physics provided from the ambient ScrollConfiguration.

If an explicit ScrollBehavior is provided to Scrollable.scrollBehavior, the ScrollPhysics provided by that behavior will take precedence after Scrollable.physics.

The physics can be changed dynamically, but new physics will only take effect if the class of the provided object changes. Merely constructing a new instance with a different configuration is insufficient to cause the physics to be reapplied. (This is because the final object used is generated dynamically, which can be relatively expensive, and it would be inefficient to speculatively create this object each frame to see if the physics should be updated.)

See also:

  • AlwaysScrollableScrollPhysics, which can be used to indicate that the scrollable should react to scroll requests (and possible overscroll) even if the scrollable's contents fit without scrolling being necessary.

Implementation

final ScrollPhysics? physics;