Unverified Commit 47922979 authored by Greg Price's avatar Greg Price Committed by GitHub

Document on ScrollPhysics the requirement to override applyTo (#121850)

Document on ScrollPhysics the requirement to override applyTo
parent 28b65e08
......@@ -67,6 +67,11 @@ enum ScrollDecelerationRate {
/// // ...
/// final ScrollPhysics mergedPhysics = physics.applyTo(const AlwaysScrollableScrollPhysics());
/// ```
///
/// When implementing a subclass, you must override [applyTo] so that it returns
/// an appropriate instance of your subclass. Otherwise, classes like
/// [Scrollable] that inform a [ScrollPosition] will combine them with
/// the default [ScrollPhysics] object instead of your custom subclass.
@immutable
class ScrollPhysics {
/// Creates an object with the default scroll physics.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment