ScrollTransitionPhase class

Where a widget is in its scroll transition, as a value from -1 to 1.

  • -1: fully past the top/leading edge.
  • 0: fully visible (identity).
  • 1: fully past the bottom/trailing edge.

"Top/leading" is screen space: the physical top for vertical scrolling, and the leading edge (left in LTR, right in RTL) for horizontal scrolling. The scroll direction and reverse do not change it.

Annotations

Constructors

ScrollTransitionPhase(double value)
Creates a phase with the given value, clamped to -1..1.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isIdentity bool
Whether the widget is fully visible (value == 0).
no setter
kind ScrollPhase
The discrete phase this value belongs to.
no setter
magnitude double
How far the widget is from identity, from 0 to 1, whichever edge it is crossing.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value double
The continuous phase value from -1 to 1.
final

Methods

closeTo(ScrollTransitionPhase other, {double tolerance = 1e-6}) bool
Whether other is within tolerance of this phase.
curved(Curve curve) ScrollTransitionPhase
Returns this phase with its magnitude reshaped by curve. The sign stays the same.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

discreteFromGeometry(VisualEffectGeometry geometry, {double topInset = 0, double bottomInset = 0, double threshold = 0.5}) ScrollTransitionPhase
Computes the discrete phase used by ScrollTransitionConfiguration.animated. It is identity when at least threshold of the widget's main-axis extent is inside the inset region (any visible part when threshold is 0). Otherwise it is topLeading or bottomTrailing, whichever edge the widget is beyond.
fromGeometry(VisualEffectGeometry geometry, {double topInset = 0, double bottomInset = 0}) ScrollTransitionPhase
Computes the continuous phase for geometry.

Constants

bottomTrailing → const ScrollTransitionPhase
Fully past the bottom/trailing edge.
identity → const ScrollTransitionPhase
The fully-visible phase.
topLeading → const ScrollTransitionPhase
Fully past the top/leading edge.