SnapSheetPhysics class
Creates snapping physics for a Sheet.
When the user stops dragging, the sheet will be snapped to one of closest value inside the stops list
If relative is true, this values must be between 0 and 1, where 0 represent the sheet totally hidden and 1 fully visible.
If relative is false, the values are real pixels and will be clamped to Sheet.minExtent and Sheet.maxExtent
- Inheritance
-
- Object
- ScrollPhysics
- SnapSheetPhysics
- Mixed in types
Constructors
-
SnapSheetPhysics({ScrollPhysics? parent, List<
double> stops = const <double>[], bool relative = true}) -
Creates snapping physics for a Sheet.
const
Properties
- allowImplicitScrolling → bool
-
Whether a viewport is allowed to change its scroll position implicitly in
response to a call to RenderObject.showOnScreen.
no setteroverride
- allowUserScrolling → bool
-
Whether a viewport is allowed to change the scroll position as the result of user input.
no setterinherited
- dragStartDistanceMotionThreshold → double?
-
The minimum amount of pixel distance drags must move by to start motion
the first time or after each time the drag motion stopped.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxFlingVelocity → double
-
Scroll fling velocity magnitudes will be clamped to this value.
no setterinherited
- minFlingDistance → double
-
The minimum distance an input pointer drag must have moved to be
considered a scroll fling gesture.
no setterinherited
- minFlingVelocity → double
-
The minimum velocity for an input pointer drag to be considered a
scroll fling.
no setterinherited
- parent → ScrollPhysics?
-
If non-null, determines the default behavior for each method.
finalinherited
- relative → bool
-
If relative is true, this values must be between 0 and 1, where
0 represent the sheet totally hidden and 1 fully visible.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spring → SpringDescription
-
The spring to use for ballistic simulations.
no setterinherited
-
stops
→ List<
double> -
Positions where the sheet could be snapped once the user stops
dragging
final
- tolerance → Tolerance
-
Deprecated. Call toleranceFor instead.
no setterinherited
Methods
-
adjustPositionForNewDimensions(
{required ScrollMetrics oldPosition, required ScrollMetrics newPosition, required bool isScrolling, required double velocity}) → double -
Describes what the scroll position should be given new viewport dimensions.
override
-
applyBoundaryConditions(
ScrollMetrics position, double value) → double -
Determines the overscroll by applying the boundary conditions.
inherited
-
applyPhysicsToUserOffset(
ScrollMetrics position, double offset) → double -
Used by DragScrollActivity and other user-driven activities to convert
an offset in logical pixels as provided by the DragUpdateDetails into a
delta to apply (subtract from the current position) using
ScrollActivityDelegate.setPixels.
inherited
-
applyTo(
ScrollPhysics? ancestor) → SnapSheetPhysics -
Combines this ScrollPhysics instance with the given physics.
override
-
buildParent(
ScrollPhysics? ancestor) → ScrollPhysics? -
If parent is null then return ancestor, otherwise recursively build a
ScrollPhysics that has
ancestor
as its parent.inherited -
carriedMomentum(
double existingVelocity) → double -
Returns the velocity carried on repeated flings.
inherited
-
createBallisticSimulation(
ScrollMetrics position, double velocity) → Simulation? -
Returns a simulation for ballistic scrolling starting from the given
position with the given velocity.
override
-
extentFor(
ScrollMetrics position) → double -
getPageFromPixels(
double pixels, double extent) → int -
getPixelsFromPage(
ScrollMetrics position, int page) → double -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recommendDeferredLoading(
double velocity, ScrollMetrics metrics, BuildContext context) → bool -
Provides a heuristic to determine if expensive frame-bound tasks should be
deferred.
inherited
-
shouldAcceptUserOffset(
ScrollMetrics position) → bool -
Whether the scrollable should let the user adjust the scroll offset, for
example by dragging. If allowUserScrolling is false, the scrollable
will never allow user input to change the scroll position.
inherited
-
shouldReload(
covariant ScrollPhysics old) → bool -
override
-
toleranceFor(
ScrollMetrics metrics) → Tolerance -
The tolerance to use for ballistic simulations.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited