pub struct SliverListView<State: 'static> { /* private fields */ }Expand description
A lazy, keyed list of rows that size themselves. See the module docs.
Implementations§
Source§impl<State: 'static> SliverListView<State>
impl<State: 'static> SliverListView<State>
Sourcepub fn estimated_item_extent(self, estimate_px: f64) -> Self
pub fn estimated_item_extent(self, estimate_px: f64) -> Self
Assume a row never laid out is estimate_px long along the scroll
axis (48 px unless set) — what the scroll extent counts for every
unmeasured row and what keyed anchoring shifts by per prepended row.
§Panics
If estimate_px is not positive and finite.
Sourcepub fn on_near_start<F: Fn(&mut State) + 'static>(
self,
callback: F,
threshold_px: f64,
) -> Self
pub fn on_near_start<F: Fn(&mut State) + 'static>( self, callback: F, threshold_px: f64, ) -> Self
Fire callback when the list’s start comes within threshold_px of
the viewport’s leading edge — the “load older” edge. See the
module docs’ Near edges and semantics.
Sourcepub fn on_near_end<F: Fn(&mut State) + 'static>(
self,
callback: F,
threshold_px: f64,
) -> Self
pub fn on_near_end<F: Fn(&mut State) + 'static>( self, callback: F, threshold_px: f64, ) -> Self
Fire callback when the list’s end comes within threshold_px of the
viewport’s trailing edge — the “load newer” edge, mirroring
SliverListView::on_near_start.
Trait Implementations§
Source§impl<State: 'static> View<State> for SliverListView<State>
impl<State: 'static> View<State> for SliverListView<State>
Source§fn build(&self, _ctx: &mut BuildCtx<'_>) -> SliverListWidget
fn build(&self, _ctx: &mut BuildCtx<'_>) -> SliverListWidget
No layout has run yet, so there is no cache region to window against: nothing is materialised until the first rebuild after it.
Source§type Element = SliverListWidget
type Element = SliverListWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut SliverListWidget,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut SliverListWidget, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.