@@ -258,6 +266,47 @@ class SliverConstraints extends Constraints {
...
@@ -258,6 +266,47 @@ class SliverConstraints extends Constraints {
/// For a vertical list, this is the height of the viewport.
/// For a vertical list, this is the height of the viewport.
finaldoubleviewportMainAxisExtent;
finaldoubleviewportMainAxisExtent;
/// Where the cache area starts relative to the [scrollOffset].
///
/// Slivers that fall into the cache area located before the leading edge and
/// after the trailing edge of the viewport should still render content
/// because they are about to become visible when the user scrolls.
///
/// The [cacheOrigin] describes where the [remainingCacheExtent] starts relative
/// to the [scrollOffset]. A cache origin of 0 means that the sliver does not
/// have to provide any content before the current [scrollOffset]. A
/// [cacheOrigin] of -250.0 means that even though the first visible part of
/// the sliver will be at the provided [scrollOffset], the sliver should
/// render content starting 250.0 before the [scrollOffset] to fill the
/// cache area of the viewport.
///
/// The [cacheOrigin] is always negative or zero and will never exceed
/// -[scrollOffset]. In other words, a sliver is never asked to provide
/// content before its zero [scrollOffset].
///
/// See also:
/// * [RenderViewport.cacheExtent] for a description of a viewport's cache area.
finaldoublecacheOrigin;
/// Describes how much content the sliver should provide starting from the
/// [cacheOrigin].
///
/// Not all content in the [remainingCacheExtent] will be visible as some
/// of it might fall into the cache area of the viewport.
///
/// Each sliver should start laying out content at the [cacheOrigin] and
/// try to provide as much content as the [remainingCacheExtent] allows.
///
/// The [remainingCacheExtent] is always larger or equal to the
/// [remainingPaintExtent]. Content, that falls in the [remainingCacheExtent],
/// but is outside of the [remainingPaintExtent] is currently not visible
/// in the viewport.
///
/// See also:
/// * [RenderViewport.cacheExtent] for a description of a viewport's cache area.
finaldoubleremainingCacheExtent;
/// The axis along which the [scrollOffset] and [remainingPaintExtent] are measured.
/// The axis along which the [scrollOffset] and [remainingPaintExtent] are measured.
Axisgetaxis=>axisDirectionToAxis(axisDirection);
Axisgetaxis=>axisDirectionToAxis(axisDirection);
...
@@ -361,6 +410,8 @@ class SliverConstraints extends Constraints {
...
@@ -361,6 +410,8 @@ class SliverConstraints extends Constraints {
verify(axisDirectionToAxis(axisDirection)!=axisDirectionToAxis(crossAxisDirection),'The "axisDirection" and the "crossAxisDirection" are along the same axis.');
verify(axisDirectionToAxis(axisDirection)!=axisDirectionToAxis(crossAxisDirection),'The "axisDirection" and the "crossAxisDirection" are along the same axis.');
verify(viewportMainAxisExtent>=0.0,'The "viewportMainAxisExtent" is negative.');
verify(viewportMainAxisExtent>=0.0,'The "viewportMainAxisExtent" is negative.');
verify(remainingPaintExtent>=0.0,'The "remainingPaintExtent" is negative.');
verify(remainingPaintExtent>=0.0,'The "remainingPaintExtent" is negative.');
verify(remainingCacheExtent>=0.0,'The "remainingCacheExtent" is negative.');
verify(cacheOrigin<=0.0,'The "cacheOrigin" is positive.');
verify(isNormalized,'The constraints are not normalized.');// should be redundant with earlier checks
verify(isNormalized,'The constraints are not normalized.');// should be redundant with earlier checks
returntrue;
returntrue;
}());
}());
...
@@ -382,7 +433,9 @@ class SliverConstraints extends Constraints {
...
@@ -382,7 +433,9 @@ class SliverConstraints extends Constraints {