pub struct SliverConstraints {
pub axis_direction: AxisDirection,
pub growth_direction: GrowthDirection,
pub user_scroll_direction: ScrollDirection,
pub scroll_offset: f64,
pub preceding_scroll_extent: f64,
pub overlap: f64,
pub remaining_paint_extent: f64,
pub cross_axis_extent: f64,
pub cross_axis_direction: AxisDirection,
pub viewport_main_axis_extent: f64,
pub remaining_cache_extent: f64,
pub cache_origin: f64,
}Expand description
Immutable layout constraints for RenderSliver layout.
Fields§
§axis_direction: AxisDirectionThe direction in which scroll_offset and
remaining_paint_extent increase.
growth_direction: GrowthDirectionThe direction in which the contents of slivers are ordered.
user_scroll_direction: ScrollDirectionThe direction in which the user is attempting to scroll.
scroll_offset: f64Scroll offset in this sliver’s coordinate system of the earliest visible part of this sliver.
preceding_scroll_extent: f64Scroll distance consumed by all slivers that came before this one.
overlap: f64Pixels from the painted scroll_offset up to the
first pixel not yet painted by an earlier sliver.
remaining_paint_extent: f64Pixels of content the sliver should consider providing.
cross_axis_extent: f64Pixels in the cross-axis.
cross_axis_direction: AxisDirectionDirection in which children should be placed in the cross axis.
viewport_main_axis_extent: f64Pixels the viewport can display in the main axis.
remaining_cache_extent: f64How much content the sliver should provide starting from
cache_origin.
cache_origin: f64Where the cache area starts relative to the
scroll_offset. Always negative or zero.
Implementations§
Source§impl SliverConstraints
impl SliverConstraints
Sourcepub const fn new(
axis_direction: AxisDirection,
growth_direction: GrowthDirection,
user_scroll_direction: ScrollDirection,
scroll_offset: f64,
preceding_scroll_extent: f64,
overlap: f64,
remaining_paint_extent: f64,
cross_axis_extent: f64,
cross_axis_direction: AxisDirection,
viewport_main_axis_extent: f64,
remaining_cache_extent: f64,
cache_origin: f64,
) -> SliverConstraints
pub const fn new( axis_direction: AxisDirection, growth_direction: GrowthDirection, user_scroll_direction: ScrollDirection, scroll_offset: f64, preceding_scroll_extent: f64, overlap: f64, remaining_paint_extent: f64, cross_axis_extent: f64, cross_axis_direction: AxisDirection, viewport_main_axis_extent: f64, remaining_cache_extent: f64, cache_origin: f64, ) -> SliverConstraints
Creates sliver constraints with the given information.
Sourcepub const fn copy_with(self) -> SliverConstraints
pub const fn copy_with(self) -> SliverConstraints
Creates a copy of this object. Chain field replacements.
Sourcepub const fn axis_direction(self, value: AxisDirection) -> SliverConstraints
pub const fn axis_direction(self, value: AxisDirection) -> SliverConstraints
Sets axis_direction.
Sourcepub const fn growth_direction(self, value: GrowthDirection) -> SliverConstraints
pub const fn growth_direction(self, value: GrowthDirection) -> SliverConstraints
Sets growth_direction.
Sourcepub const fn user_scroll_direction(
self,
value: ScrollDirection,
) -> SliverConstraints
pub const fn user_scroll_direction( self, value: ScrollDirection, ) -> SliverConstraints
Sets user_scroll_direction.
Sourcepub const fn scroll_offset(self, value: f64) -> SliverConstraints
pub const fn scroll_offset(self, value: f64) -> SliverConstraints
Sets scroll_offset.
Sourcepub const fn preceding_scroll_extent(self, value: f64) -> SliverConstraints
pub const fn preceding_scroll_extent(self, value: f64) -> SliverConstraints
Sets preceding_scroll_extent.
Sourcepub const fn overlap(self, value: f64) -> SliverConstraints
pub const fn overlap(self, value: f64) -> SliverConstraints
Sets overlap.
Sourcepub const fn remaining_paint_extent(self, value: f64) -> SliverConstraints
pub const fn remaining_paint_extent(self, value: f64) -> SliverConstraints
Sets remaining_paint_extent.
Sourcepub const fn cross_axis_extent(self, value: f64) -> SliverConstraints
pub const fn cross_axis_extent(self, value: f64) -> SliverConstraints
Sets cross_axis_extent.
Sourcepub const fn cross_axis_direction(
self,
value: AxisDirection,
) -> SliverConstraints
pub const fn cross_axis_direction( self, value: AxisDirection, ) -> SliverConstraints
Sets cross_axis_direction.
Sourcepub const fn viewport_main_axis_extent(self, value: f64) -> SliverConstraints
pub const fn viewport_main_axis_extent(self, value: f64) -> SliverConstraints
Sourcepub const fn remaining_cache_extent(self, value: f64) -> SliverConstraints
pub const fn remaining_cache_extent(self, value: f64) -> SliverConstraints
Sets remaining_cache_extent.
Sourcepub const fn cache_origin(self, value: f64) -> SliverConstraints
pub const fn cache_origin(self, value: f64) -> SliverConstraints
Sets cache_origin.
Sourcepub fn normalized_growth_direction(self) -> GrowthDirection
pub fn normalized_growth_direction(self) -> GrowthDirection
growth_direction as if the axis were down or
right.
Sourcepub fn as_box_constraints(
self,
min_extent: f64,
max_extent: f64,
cross_axis_extent: Option<f64>,
) -> BoxConstraints
pub fn as_box_constraints( self, min_extent: f64, max_extent: f64, cross_axis_extent: Option<f64>, ) -> BoxConstraints
BoxConstraints that reflect these sliver constraints.
Dart named defaults: min_extent 0, max_extent infinity, cross_axis_extent
this sliver’s cross extent.