Incular logoIncular
API ReferenceNavigation & Scrolling

SliverList

Lazy list sliver with fixed, varied, and prototype extents.

Everything here implements the Sliver trait (build, create_render_sliver). The retained viewport materializes only the visible range plus a bounded cache.

use incular::prelude::*;

fn main() {
    let app = Application::new(|_cx| {
        CustomScrollView::new(vec![
            Box::new(SliverList::builder(10, |i| {
                Text::new(format!("row {i}"))
            })) as Box<dyn Sliver>,
        ]).into()
    })
    .expect("valid application");
    incular::run(app).expect("run application");
}
TypeExtent strategy
SliverListBuilder rows, estimated extents
SliverFixedExtentListUniform extent, direct division math
SliverVariedExtentListPer-index extent function
SliverPrototypeExtentListExtents from a measured prototype
SliverLayoutGeometry + materialized children of one layout pass

Fixed extents derive ranges by division; variable extents learn exact sizes from laid-out children and compensate the visible anchor when rows above change size.

Related: SliverGrid, CustomScrollView, ListView.