logo
pub trait RepeatedComponent: Component {
    type Data: 'static;
    fn update(&self, index: usize, data: Self::Data);

    fn listview_layout(
        self: Pin<&Self>,
        _offset_y: &mut f32,
        _viewport_width: Pin<&Property<f32>>
    ) { ... }
fn box_layout_data(
        self: Pin<&Self>,
        _orientation: Orientation
    ) -> BoxLayoutCellData { ... } }
Expand description

Component that can be instantiated by a repeater.

Associated Types

The data corresponding to the model

Required methods

Update this component at the given index and the given data

Provided methods

Layout this item in the listview

offset_y is the y position where this item should be placed. it should be updated to be to the y position of the next item.

Returns what’s needed to perform the layout if this component is in a box layout

Implementors