A list of count rows, each row_h pixels high, with pool row boxes (the rows that show, plus two: height / row_h + 2), and the view of row i from row(i).
Rows of your own views instead of a line of text. .heights(f) gives rows of different heights.
Signature
pub const fn virtual_rows<M, V, F: Fn(usize) -> V>( count: usize, row_h: u32, pool: usize, row: F, ) -> VirtualRows<M, F>Methods
.heights(height: fn(usize) -> u32) -> Self— Rows of different heights:height(i)is the height of rowiin pixels (row_his then only the guess the pool is sized for, so size the pool for the shortest row)..height(height: Length) -> Self— The list's height, which has to be fixed or filling (seeVirtualList::height).
Example
use fusuma::{Length, text, virtual_rows};
let view = virtual_rows(1000, 32, 6, |i| text(if i % 2 == 0 { "even" } else { "odd" })).height(Length::Fixed(96));
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.nodes() < 40, "a thousand rows, a few nodes");