Skip to main content

SlottedContainerRenderObjectMixin

Trait SlottedContainerRenderObjectMixin 

Source
pub trait SlottedContainerRenderObjectMixin<S>: RenderObject
where S: SlotValue,
{ type ChildType: ErasedRenderObject; // Required methods fn slotted_container_data( self: RenderHandle<Self>, app: &App, ) -> &SlottedContainerRenderObjectData<S, Self::ChildType>; fn slotted_container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut SlottedContainerRenderObjectData<S, Self::ChildType>; // Provided methods fn child_for_slot( self: RenderHandle<Self>, app: &App, slot: &S, ) -> Option<Self::ChildType> { ... } fn children(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType> { ... } fn debug_name_for_slot(&self, slot: &S) -> String { ... } fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, ) { ... } fn did_detach(self: RenderHandle<Self>, app: &mut App) { ... } fn redepth_children(self: RenderHandle<Self>, app: &mut App) { ... } fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), ) { ... } fn debug_describe_children( self: RenderHandle<Self>, app: &App, ) -> Vec<Rc<dyn DiagnosticsNode>> { ... } fn set_child( self: RenderHandle<Self>, app: &mut App, child: Option<Self::ChildType>, slot: &S, ) { ... } fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, slot: &S, old_slot: &S, ) { ... } }
Expand description

Mixin for a RenderObject configured by a SlottedMultiChildRenderObjectWidget.

The RenderObject child currently occupying a given slot can be obtained by calling child_for_slot.

Implementers must call did_attach, did_detach, redepth_children and visit_children from their RenderObject overrides of the same names, as Dart’s mixin overrides them.

Required Associated Types§

Source

type ChildType: ErasedRenderObject

Dart’s ChildType.

Required Methods§

Provided Methods§

Source

fn child_for_slot( self: RenderHandle<Self>, app: &App, slot: &S, ) -> Option<Self::ChildType>

Returns the RenderObject child that is currently occupying the provided slot.

Returns None if no RenderObject is configured for the given slot.

Source

fn children(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType>

Returns an iterable over all non-None children.

The children are returned in the order the slots were filled.

Source

fn debug_name_for_slot(&self, slot: &S) -> String

Returns the debug name for a given slot.

This method is called by debugDescribeChildren for each slot that is currently occupied by a child to obtain a name for that slot for debug outputs.

Source

fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, )

Dart’s attach after super.attach(owner).

Source

fn did_detach(self: RenderHandle<Self>, app: &mut App)

Dart’s detach after super.detach().

Source

fn redepth_children(self: RenderHandle<Self>, app: &mut App)

Dart’s redepthChildren.

Source

fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )

Dart’s visitChildren.

Source

fn debug_describe_children( self: RenderHandle<Self>, app: &App, ) -> Vec<Rc<dyn DiagnosticsNode>>

Flutter’s SlottedContainerRenderObjectMixin.debugDescribeChildren: the children in the order children answers, each named by the slot it occupies.

Source

fn set_child( self: RenderHandle<Self>, app: &mut App, child: Option<Self::ChildType>, slot: &S, )

Dart’s _setChild.

Source

fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, slot: &S, old_slot: &S, )

Dart’s _moveChild.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§