SliverConstraints class

Immutable layout constraints for RenderSliver layout.

The SliverConstraints describe the current scroll state of the viewport from the point of view of the sliver receiving the constraints. For example, a scrollOffset of zero means that the leading edge of the sliver is visible in the viewport, not that the viewport itself has a zero scroll offset.

Inheritance

Constructors

SliverConstraints({@required AxisDirection axisDirection, @required GrowthDirection growthDirection, @required ScrollDirection userScrollDirection, @required double scrollOffset, @required double precedingScrollExtent, @required double overlap, @required double remainingPaintExtent, @required double crossAxisExtent, @required AxisDirection crossAxisDirection, @required double viewportMainAxisExtent, @required double remainingCacheExtent, @required double cacheOrigin })
Creates sliver constraints with the given information. [...]
const

Properties

axis Axis
The axis along which the scrollOffset and remainingPaintExtent are measured.
read-only
axisDirection AxisDirection
The direction in which the scrollOffset and remainingPaintExtent increase.
final
cacheOrigin double
Where the cache area starts relative to the scrollOffset. [...]
final
crossAxisDirection AxisDirection
The direction in which children should be placed in the cross axis. [...]
final
crossAxisExtent double
The number of pixels in the cross-axis. [...]
final
growthDirection GrowthDirection
The direction in which the contents of slivers are ordered, relative to the axisDirection. [...]
final
hashCode int
The hash code for this object. [...]
read-only, override
isNormalized bool
Whether the constraint is expressed in a consistent manner.
read-only, override
isTight bool
Whether there is exactly one size possible given these constraints
read-only, override
normalizedGrowthDirection GrowthDirection
Return what the growthDirection would be if the axisDirection was either AxisDirection.down or AxisDirection.right. [...]
read-only
overlap double
The number of pixels from where the pixels corresponding to the scrollOffset will be painted up to the first pixel that has not yet been painted on by an earlier sliver, in the axisDirection. [...]
final
precedingScrollExtent double
The scroll distance that has been consumed by all Slivers that came before this Sliver. [...]
final
remainingCacheExtent double
Describes how much content the sliver should provide starting from the cacheOrigin. [...]
final
remainingPaintExtent double
The number of pixels of content that the sliver should consider providing. (Providing more pixels than this is inefficient.) [...]
final
scrollOffset double
The scroll offset, in this sliver's coordinate system, that corresponds to the earliest visible part of this sliver in the AxisDirection. [...]
final
userScrollDirection ScrollDirection
The direction in which the user is attempting to scroll, relative to the axisDirection and growthDirection. [...]
final
viewportMainAxisExtent double
The number of pixels the viewport can display in the main axis. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

asBoxConstraints({double minExtent: 0.0, double maxExtent: double.infinity, double crossAxisExtent }) BoxConstraints
Returns BoxConstraints that reflects the sliver constraints. [...]
copyWith({AxisDirection axisDirection, GrowthDirection growthDirection, ScrollDirection userScrollDirection, double scrollOffset, double precedingScrollExtent, double overlap, double remainingPaintExtent, double crossAxisExtent, AxisDirection crossAxisDirection, double viewportMainAxisExtent, double remainingCacheExtent, double cacheOrigin }) SliverConstraints
Creates a copy of this object but with the given fields replaced with the new values.
debugAssertIsValid({bool isAppliedConstraint: false, InformationCollector informationCollector }) bool
Asserts that the constraints are valid. [...]
override
toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override