Skip to main content

SliverFixedExtentList

Struct SliverFixedExtentList 

Source
pub struct SliverFixedExtentList {
    pub key: Option<KeyRef>,
    pub delegate: SliverChildDelegateRef,
    pub item_extent: f64,
}
Expand description

A sliver that places multiple box children with the same main axis extent in a linear array.

To learn more about slivers, see CustomScrollView::slivers.

SliverFixedExtentList places its children in a linear array along the main axis starting at offset zero and without gaps. Each child is forced to have the item_extent in the main axis and the SliverConstraints::cross_axis_extent in the cross axis.

SliverFixedExtentList is more efficient than SliverList because SliverFixedExtentList does not need to perform layout on its children to obtain their extent in the main axis.

See also:

  • SliverVariedExtentList, which supports children with varying (but known upfront) extents.
  • SliverList, which does not require its children to have the same extent in the main axis.

Fields§

§key: Option<KeyRef>§delegate: SliverChildDelegateRef

The delegate that provides the children for this widget.

§item_extent: f64

The extent the children are forced to have in the main axis.

Implementations§

Source§

impl SliverFixedExtentList

Source

pub fn new( delegate: SliverChildDelegateRef, item_extent: f64, ) -> SliverFixedExtentList

Creates a sliver that places box children with the same main axis extent in a linear array.

Source

pub fn builder( item_builder: impl Fn(&mut App, BuildContext, i32) -> Option<WidgetRef> + 'static, item_extent: f64, ) -> SliverFixedExtentListBuilder

A sliver that places multiple box children in a linear array along the main axis, built lazily.

This constructor is appropriate for sliver lists with a large (or infinite) number of children whose extent is already determined.

Source

pub fn list( children: Vec<WidgetRef>, item_extent: f64, ) -> SliverFixedExtentListList

A sliver that places multiple box children in a linear array along the main axis, built from an explicit list of widgets.

Source

pub fn key(self, key: KeyRef) -> SliverFixedExtentList

Dart SliverFixedExtentList(key:).

Trait Implementations§

Source§

impl Debug for SliverFixedExtentList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RenderObjectWidget for SliverFixedExtentList

Source§

type RenderObject = RenderSliverFixedExtentList

The render object this widget creates; Dart’s covariant RenderObject parameter type.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn create_render_object( &self, app: &mut App, context: BuildContext, ) -> AnyRenderObject

Creates an instance of the RenderObject class that this widget represents, using the configuration described by this widget. Read more
Source§

fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderSliverFixedExtentList>, )

Copies the configuration described by this widget to the given render object, which will be of the same type as returned by this object’s create_render_object. Read more
Source§

fn to_string_short(&self) -> String

Dart’s toStringShort, for a widget that names itself apart from its type, as SizedBox.expand does; see Widget::to_string_short.
Source§

fn debug_check_constructor(&self)

Source§

fn debug_visit_onstage_children( &self, app: &App, children: &[AnyElement], visitor: &mut dyn FnMut(AnyElement), )

Dart’s debugVisitOnstageChildren of the element this widget makes, for a widget whose Dart element subclass overrides it only to hide children (_OffstageElement, _IndexedStackElement): calls visitor for each of children, in order, that is onstage. Waft’s generic single- and multi-child elements stand in for those subclasses and ask their widget here; an element of a widget’s own overrides Element::debug_visit_onstage_children instead.
Source§

fn did_unmount_render_object( &self, app: &mut App, render_object: RenderHandle<Self::RenderObject>, )

A render object previously associated with this widget has been removed from the tree. The given RenderObject will be of the same type as returned by this object’s create_render_object.
Source§

impl SliverMultiBoxAdaptorWidget for SliverFixedExtentList

Source§

fn delegate(&self) -> &SliverChildDelegateRef

The delegate that provides the children for this widget. Read more
Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Dart’s SliverMultiBoxAdaptorWidget.debugFillProperties, which a subclass’s own body calls where Dart writes super.
Source§

fn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElement
where Self: Sized,

Creates the element that lazily builds this widget’s children. Read more
Source§

fn estimate_max_scroll_offset( &self, constraints: Option<SliverConstraints>, first_index: i32, last_index: i32, leading_scroll_offset: f64, trailing_scroll_offset: f64, ) -> Option<f64>

Returns an estimate of the max scroll extent for all the children. Read more
Source§

impl SliverWithKeepAliveWidget for SliverFixedExtentList

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<SliverMultiBoxAdaptorKind> for W

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>