pub struct SliverPrototypeExtentList {
pub key: Option<KeyRef>,
pub delegate: SliverChildDelegateRef,
pub prototype_item: WidgetRef,
}Expand description
A sliver that places its box children in a linear array and constrains them to have the same extent as a prototype item along the main axis.
To learn more about slivers, see CustomScrollView::slivers.
SliverPrototypeExtentList arranges its children in a line along the main axis starting at
offset zero and without gaps. Each child is constrained to the same extent as the
prototype_item along the main axis and the
SliverConstraints::cross_axis_extent along the cross axis.
SliverPrototypeExtentList is more efficient than SliverList because
SliverPrototypeExtentList does not need to lay out its children to obtain their extent
along the main axis. It’s a little more flexible than SliverFixedExtentList because there’s
no need to determine the appropriate item extent in pixels.
See also:
SliverFixedExtentList, whose children are forced to a given pixel extent.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.SliverFillViewport, which sizes its children based on the size of the viewport, regardless of what else is in the scroll view.
Fields§
§key: Option<KeyRef>§delegate: SliverChildDelegateRefThe delegate that provides the children for this widget.
prototype_item: WidgetRefDefines the main axis extent of all of this sliver’s children.
The prototype_item is laid out before the rest of the sliver’s
children and its size along the main axis fixes the size of each child. The
prototype_item is essentially Offstage: it is not painted and
it cannot respond to input.
Implementations§
Source§impl SliverPrototypeExtentList
impl SliverPrototypeExtentList
Sourcepub fn new<K>(
delegate: SliverChildDelegateRef,
prototype_item: impl IntoWidget<K>,
) -> SliverPrototypeExtentList
pub fn new<K>( delegate: SliverChildDelegateRef, prototype_item: impl IntoWidget<K>, ) -> SliverPrototypeExtentList
Creates a sliver that places its box children in a linear array and constrains them to have the same extent as a prototype item along the main axis.
Sourcepub fn builder<K>(
item_builder: impl Fn(&mut App, BuildContext, i32) -> Option<WidgetRef> + 'static,
prototype_item: impl IntoWidget<K>,
) -> SliverPrototypeExtentListBuilder
pub fn builder<K>( item_builder: impl Fn(&mut App, BuildContext, i32) -> Option<WidgetRef> + 'static, prototype_item: impl IntoWidget<K>, ) -> SliverPrototypeExtentListBuilder
A sliver that places its box children in a linear array and constrains them to have the same extent as a prototype item along the main axis.
This constructor is appropriate for sliver lists with a large (or infinite) number of children whose extent is already determined.
Providing an item_count improves the ability of the sliver to estimate the maximum
scroll extent.
item_builder will be called only with indices greater than or equal to zero and less
than item_count.
The prototype_item argument is used to determine the extent of each item.
Sourcepub fn list<K>(
children: Vec<WidgetRef>,
prototype_item: impl IntoWidget<K>,
) -> SliverPrototypeExtentListList
pub fn list<K>( children: Vec<WidgetRef>, prototype_item: impl IntoWidget<K>, ) -> SliverPrototypeExtentListList
A sliver that places multiple box children in a linear array along the main axis.
This constructor uses a list of widgets to build the sliver.
Sourcepub fn key(self, key: KeyRef) -> SliverPrototypeExtentList
pub fn key(self, key: KeyRef) -> SliverPrototypeExtentList
Dart SliverPrototypeExtentList(key:).
Trait Implementations§
Source§impl Debug for SliverPrototypeExtentList
impl Debug for SliverPrototypeExtentList
Source§impl RenderObjectWidget for SliverPrototypeExtentList
impl RenderObjectWidget for SliverPrototypeExtentList
Source§type RenderObject = RenderSliverPrototypeExtentList
type RenderObject = RenderSliverPrototypeExtentList
covariant RenderObject parameter type.Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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
fn create_render_object( &self, app: &mut App, context: BuildContext, ) -> AnyRenderObject
RenderObject class that this widget represents, using the
configuration described by this widget. Read moreSource§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
toStringShort, for a widget that names itself apart from its type, as
SizedBox.expand does; see Widget::to_string_short.Source§fn debug_visit_onstage_children(
&self,
app: &App,
children: &[AnyElement],
visitor: &mut dyn FnMut(AnyElement),
)
fn debug_visit_onstage_children( &self, app: &App, children: &[AnyElement], visitor: &mut dyn FnMut(AnyElement), )
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 update_render_object(
&self,
app: &mut App,
context: BuildContext,
render_object: RenderHandle<Self::RenderObject>,
)
fn update_render_object( &self, app: &mut App, context: BuildContext, render_object: RenderHandle<Self::RenderObject>, )
create_render_object. Read moreSource§fn did_unmount_render_object(
&self,
app: &mut App,
render_object: RenderHandle<Self::RenderObject>,
)
fn did_unmount_render_object( &self, app: &mut App, render_object: RenderHandle<Self::RenderObject>, )
RenderObject will be of the same type as returned by this object’s
create_render_object.Source§impl SliverMultiBoxAdaptorWidget for SliverPrototypeExtentList
impl SliverMultiBoxAdaptorWidget for SliverPrototypeExtentList
Source§fn delegate(&self) -> &SliverChildDelegateRef
fn delegate(&self) -> &SliverChildDelegateRef
Source§fn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElement
fn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElement
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
SliverMultiBoxAdaptorWidget.debugFillProperties, which a subclass’s own body
calls where Dart writes super.impl SliverWithKeepAliveWidget for SliverPrototypeExtentList
Auto Trait Implementations§
impl !RefUnwindSafe for SliverPrototypeExtentList
impl !Send for SliverPrototypeExtentList
impl !Sync for SliverPrototypeExtentList
impl !UnwindSafe for SliverPrototypeExtentList
impl Forget for SliverPrototypeExtentList
impl Freeze for SliverPrototypeExtentListwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn SliverChildDelegate> is !null: Freeze,
PhantomData<RcInner<dyn SliverChildDelegate>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for SliverPrototypeExtentList
impl Unpin for SliverPrototypeExtentList
impl UnsafeUnpin for SliverPrototypeExtentListwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn SliverChildDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliverChildDelegate>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<SliverMultiBoxAdaptorKind> for Wwhere
W: SliverMultiBoxAdaptorWidget,
<W as RenderObjectWidget>::RenderObject: RenderSliverMultiBoxAdaptor,
impl<W> IntoWidget<SliverMultiBoxAdaptorKind> for Wwhere
W: SliverMultiBoxAdaptorWidget,
<W as RenderObjectWidget>::RenderObject: RenderSliverMultiBoxAdaptor,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.