pub struct SliverToBoxAdapter {
pub key: Option<KeyRef>,
pub child: Option<Rc<dyn Widget>>,
}Expand description
A sliver that contains a single box widget.
Slivers are special-purpose widgets that can be combined using a CustomScrollView to
create custom scroll effects. A SliverToBoxAdapter is a basic sliver that creates a
bridge back to one of the usual box-based widgets.
To learn more about slivers, see CustomScrollView::slivers.
Rather than using multiple SliverToBoxAdapter widgets to display multiple box widgets
in a CustomScrollView, consider using SliverList, SliverFixedExtentList,
SliverPrototypeExtentList, or SliverGrid, which are more efficient because they
instantiate only those children that are actually visible through the scroll view’s
viewport.
See also:
CustomScrollView, which displays a scrollable list of slivers.SliverList, which displays multiple box widgets in a linear array.SliverFixedExtentList, which displays multiple box widgets with the same main-axis extent in a linear array.SliverGrid, which displays multiple box widgets in arbitrary positions.
Fields§
§key: Option<KeyRef>§child: Option<Rc<dyn Widget>>Implementations§
Source§impl SliverToBoxAdapter
impl SliverToBoxAdapter
Sourcepub fn new() -> SliverToBoxAdapter
pub fn new() -> SliverToBoxAdapter
Creates a sliver that contains a single box widget.
Sourcepub fn key(self, key: KeyRef) -> SliverToBoxAdapter
pub fn key(self, key: KeyRef) -> SliverToBoxAdapter
Dart SliverToBoxAdapter(key:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> SliverToBoxAdapter
pub fn child<K>(self, child: impl IntoWidget<K>) -> SliverToBoxAdapter
Dart SliverToBoxAdapter(child:).
Trait Implementations§
Source§impl Debug for SliverToBoxAdapter
impl Debug for SliverToBoxAdapter
Source§impl Default for SliverToBoxAdapter
impl Default for SliverToBoxAdapter
Source§fn default() -> SliverToBoxAdapter
fn default() -> SliverToBoxAdapter
Source§impl RenderObjectWidget for SliverToBoxAdapter
impl RenderObjectWidget for SliverToBoxAdapter
Source§type RenderObject = RenderSliverToBoxAdapter
type RenderObject = RenderSliverToBoxAdapter
covariant RenderObject parameter type.Source§fn create_render_object(
&self,
app: &mut App,
_context: AnyElement,
) -> AnyRenderObject
fn create_render_object( &self, app: &mut App, _context: AnyElement, ) -> AnyRenderObject
RenderObject class that this widget represents, using the
configuration described by this widget. Read moreSource§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 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: AnyElement,
render_object: RenderHandle<Self::RenderObject>,
)
fn update_render_object( &self, app: &mut App, context: AnyElement, 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.Auto Trait Implementations§
impl !RefUnwindSafe for SliverToBoxAdapter
impl !Send for SliverToBoxAdapter
impl !Sync for SliverToBoxAdapter
impl !UnwindSafe for SliverToBoxAdapter
impl Forget for SliverToBoxAdapter
impl Freeze for SliverToBoxAdapter
impl Move for SliverToBoxAdapter
impl Unpin for SliverToBoxAdapter
impl UnsafeUnpin for SliverToBoxAdapterwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: 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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<W> IntoWidget<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
impl<W> IntoWidget<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.