SnapComponent class abstract

Abstract base class for snap components, providing a contract for calculating the size of components within a snapping behavior.

Implementers
Annotations

Constructors

SnapComponent()
const
SnapComponent.fraction({required Components component, required double fraction})
Factory constructor to create a SnapComponentAtFraction, which stops at a specific fraction position.
const
factory
SnapComponent.fractionOffset({required Components component, double fraction, double size})
Factory constructor to create a SnapComponentWithOffsetFraction, which combines a size multiplier and an fraction relative to the viewport.
const
factory
SnapComponent.map(SnapComponent component, {required OffsetMap map})
Factory constructor to create a SnapComponentMap, which applies a mapping function to another SnapComponent.
const
factory
SnapComponent.merge({required SnapComponent a, required SnapComponent b, required OffsetMerge merge})
Factory constructor to create a SnapComponentMerge, which merges the sizes of two components.
const
factory
SnapComponent.offset({required Components component, double offset, double size})
Factory constructor to create a SnapComponentWithOffset with a component, size, and offset.
const
factory
SnapComponent.position({required Components component, required double position})
Factory constructor to create a SnapComponentAtPosition, which stops at a specific pixel position.
const
factory
SnapComponent.size({required Components component, double size})
Factory constructor to create a SnapComponentSize with the specified component and size.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getComponentOffsetFromTop<T>(MultiStateSheetExtent<T> extent, Components component) double
Gets the offset of the specified component from the top of viewport.
getComponentSize<T>(MultiStateSheetExtent<T> extent, Components component) double
Gets the base size of the specified component relative to the extent's initial configuration.
getSize<T>(MultiStateSheetExtent<T> extent) double
Calculates the size of the snap component relative to the provided extent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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