pub struct SliverGeometry {
pub scroll_extent: f64,
pub paint_extent: f64,
pub paint_origin: f64,
pub layout_extent: f64,
pub max_paint_extent: f64,
pub hit_test_extent: f64,
pub visible: bool,
pub has_visual_overflow: bool,
pub scroll_offset_correction: Option<f64>,
pub cache_extent: f64,
}Expand description
What a sliver reports from layout (Flutter’s SliverGeometry), in logical
px along the constraints’ axis.
Fields§
§scroll_extent: f64The (estimated) total scrollable extent.
paint_extent: f64The visible size along the axis.
paint_origin: f64First visible pixel relative to the layout position; negative paints over an earlier sliver.
layout_extent: f64Distance to the next sliver’s first pixel; usually paint_extent.
max_paint_extent: f64The (estimated) paint extent given unlimited paint space.
hit_test_extent: f64Extent of the hit region from the paint start; usually paint_extent.
visible: bool§has_visual_overflow: boolThe sliver painted outside its paint extent; the viewport must clip.
scroll_offset_correction: Option<f64>A non-zero scroll-offset adjustment after which the viewport re-runs layout, when an earlier extent estimate was wrong.
cache_extent: f64Cache extent consumed; at least layout_extent.
Implementations§
Source§impl SliverGeometry
impl SliverGeometry
Sourcepub const ZERO: SliverGeometry
pub const ZERO: SliverGeometry
An empty, invisible sliver.
Sourcepub fn new(scroll_extent: f64, paint_extent: f64, max_paint_extent: f64) -> Self
pub fn new(scroll_extent: f64, paint_extent: f64, max_paint_extent: f64) -> Self
Flutter’s constructor defaults: layout, hit-test and cache extents equal
paint_extent, visible is paint_extent > 0, the rest zero.
Sourcepub fn debug_assert_valid(&self, constraints: &SliverConstraints)
pub fn debug_assert_valid(&self, constraints: &SliverConstraints)
Flutter’s SliverGeometry.debugAssertIsValid plus the paint-extent check
against constraints; nothing without debug_assertions.