StickySnap class final Snapping

Snapping that captures the divider onto a point during the drag and holds it there until the pointer escapes past escapeFactor * tolerance. The escape radius exceeding the capture radius is the hysteresis that prevents flicker at the boundary.

Inheritance

Constructors

StickySnap({required Iterable<double> points, double tolerance = SplitterDefaults.snapTolerance, double? pixelTolerance, double escapeFactor = SplitterDefaults.stickyEscapeFactor})
Creates sticky snapping with the given escapeFactor (> 1).

Properties

escapeFactor double
The escape radius as a multiple of the capture radius (> 1). The divider holds a captured point until the pointer moves past escapeFactor * the active tolerance.
final
hashCode int
The hash code for this object.
no setterinherited
pixelTolerance double?
Largest distance in logical pixels from a point that still snaps. When set, it takes precedence over tolerance, giving a snap feel that does not change with the container size.
finalinherited
points List<double>
Start fractions to snap to, each in [0, 1]. Unmodifiable.
finalinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
tolerance double
Largest distance (in effective ratio) from a point that still snaps. Used only when pixelTolerance is null.
finalinherited

Methods

copyWith({Iterable<double>? points, double? tolerance, Object? pixelTolerance = _noUpdate, double? escapeFactor}) StickySnap
Returns a copy with the given shared fields replaced, preserving the concrete mode (and its mode-specific fields). Pass pixelTolerance: null to clear it (falling back to tolerance); omit it to keep the current value.
override
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.
inherited