SnapSpec class

Defines how a SlidingSheet should snap, or if it should at all.

Constructors

SnapSpec({bool snap = true, List<double> snappings = const [0.4, 1.0], double? initialSnap, SnapPositioning positioning = SnapPositioning.relativeToAvailableSpace, void onSnap(SheetState, double? snap)?})
Creates an object that defines how a SlidingSheet should snap, or if it should at all.
const

Properties

hashCode int
The hash code for this object.
read-onlyoverride
initialSnap double?
The initial snap extent.
final
maxSnap double
read-only
minSnap double
read-only
onSnap → (void Function(SheetState, double? snap)?)
A callback function that gets called when the SlidingSheet snaps to an extent.
final
positioning SnapPositioning
How the snaps will be positioned:
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
snap bool
If true, the SlidingSheet will snap to the provided snappings. If false, the SlidingSheet will slide from minExtent to maxExtent and then begin to scroll.
final
snappings List<double>
The snap extents for a SlidingSheet.
final

Methods

copyWith({bool? snap, List<double>? snappings, double? initialExtent, SnapPositioning? positioning, void onSnap(SheetState, double? snap)?}) SnapSpec
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 o) bool
The equality operator.
override

Static Methods

isSnap(double? snap) bool
private

Constants

expanded → const double
The snap extent that expands the whole SlidingSheet
double.infinity
footerSnap → const double
The snap extent that makes the footer fully visible without account for bottom padding on the SlidingSheet.
-3
headerFooterSnap → const double
The snap extent that makes header and footer fully visible without account for vertical padding on the SlidingSheet.
-1
headerSnap → const double
The snap extent that makes the header fully visible without account for top padding on the SlidingSheet.
-2