Incular logoIncular
API ReferenceNavigation & Scrolling

ListView

Eager and builder lists with extents, direction, and cache options.

use incular::prelude::*;

fn main() {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(
                ListView::separated(
                    50,
                    |i| Text::new(format!("item {i}")),
                    |i| Text::new(format!("— {i} —")),
                )
                .scroll_direction(Axis::Vertical)
                .cache_extent(256.0),
            )
            .build()
            .into()
    })
    .expect("valid application");
    incular::run(app).expect("run application");
}

Props

Prop

Type

Defaults: scroll_direction from WidgetDefaults, reverse = false, shrink_wrap = false. For lazy variable extents see SliverList.

Related: GridView, ScrollController.

On this page