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

Document on ScrollPhysics the requirement to override applyTo
This commit is contained in:
Greg Price
2023-03-09 17:52:34 -08:00
committed by GitHub
parent 28b65e089b
commit 47922979c6

View File

@@ -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.