pub struct VirtualizedList<'a, T> { /* private fields */ }Expand description
A virtualized list widget that renders only visible items.
This widget efficiently renders large lists by only drawing items that are currently visible in the viewport, with optional overscan for smooth scrolling.
§Variable heights
Use Self::variable_heights to measure visible items through
RenderItem::height. Enable VirtualizedListState::with_predictor to
learn from those measurements; unmeasured items use the category-zero
prediction. Scrolling remains item-aligned.
Implementations§
Source§impl<'a, T> VirtualizedList<'a, T>
impl<'a, T> VirtualizedList<'a, T>
Sourcepub fn highlight_style(self, style: Style) -> Self
pub fn highlight_style(self, style: Style) -> Self
Set highlight style for selected item.
Sourcepub fn show_scrollbar(self, show: bool) -> Self
pub fn show_scrollbar(self, show: bool) -> Self
Enable/disable scrollbar.
Sourcepub fn fixed_height(self, height: u16) -> Self
pub fn fixed_height(self, height: u16) -> Self
Set fixed item height.
Sourcepub fn variable_heights(self) -> Self
pub fn variable_heights(self) -> Self
Size each row by RenderItem::height (see
ListHeightMode::Variable).
Sourcepub fn height_mode(&self) -> ListHeightMode
pub fn height_mode(&self) -> ListHeightMode
The row sizing mode.
Trait Implementations§
Source§impl<'a, T: Debug> Debug for VirtualizedList<'a, T>
impl<'a, T: Debug> Debug for VirtualizedList<'a, T>
Source§impl<T: RenderItem> StatefulWidget for VirtualizedList<'_, T>
impl<T: RenderItem> StatefulWidget for VirtualizedList<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for VirtualizedList<'a, T>
impl<'a, T> RefUnwindSafe for VirtualizedList<'a, T>where
&'a [T]: RefUnwindSafe,
impl<'a, T> Send for VirtualizedList<'a, T>
impl<'a, T> Sync for VirtualizedList<'a, T>
impl<'a, T> Unpin for VirtualizedList<'a, T>
impl<'a, T> UnsafeUnpin for VirtualizedList<'a, T>where
&'a [T]: UnsafeUnpin,
impl<'a, T> UnwindSafe for VirtualizedList<'a, T>where
&'a [T]: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more