pub trait SlottedContainerRenderObjectMixin<S>: RenderObjectwhere
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§
Sourcetype ChildType: ErasedRenderObject
type ChildType: ErasedRenderObject
Dart’s ChildType.
Required Methods§
Sourcefn slotted_container_data(
self: RenderHandle<Self>,
app: &App,
) -> &SlottedContainerRenderObjectData<S, Self::ChildType>
fn slotted_container_data( self: RenderHandle<Self>, app: &App, ) -> &SlottedContainerRenderObjectData<S, Self::ChildType>
Mixin field access.
Sourcefn slotted_container_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut SlottedContainerRenderObjectData<S, Self::ChildType>
fn slotted_container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut SlottedContainerRenderObjectData<S, Self::ChildType>
Provided Methods§
Sourcefn child_for_slot(
self: RenderHandle<Self>,
app: &App,
slot: &S,
) -> Option<Self::ChildType>
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.
Sourcefn children(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType>
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.
Sourcefn debug_name_for_slot(&self, slot: &S) -> String
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.
Sourcefn did_attach(
self: RenderHandle<Self>,
app: &mut App,
owner: Handle<PipelineOwner>,
)
fn did_attach( self: RenderHandle<Self>, app: &mut App, owner: Handle<PipelineOwner>, )
Dart’s attach after super.attach(owner).
Sourcefn did_detach(self: RenderHandle<Self>, app: &mut App)
fn did_detach(self: RenderHandle<Self>, app: &mut App)
Dart’s detach after super.detach().
Sourcefn redepth_children(self: RenderHandle<Self>, app: &mut App)
fn redepth_children(self: RenderHandle<Self>, app: &mut App)
Dart’s redepthChildren.
Sourcefn visit_children(
self: RenderHandle<Self>,
app: &App,
visitor: &mut dyn FnMut(AnyRenderObject),
)
fn visit_children( self: RenderHandle<Self>, app: &App, visitor: &mut dyn FnMut(AnyRenderObject), )
Dart’s visitChildren.
Sourcefn debug_describe_children(
self: RenderHandle<Self>,
app: &App,
) -> Vec<Rc<dyn DiagnosticsNode>>
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.
Sourcefn set_child(
self: RenderHandle<Self>,
app: &mut App,
child: Option<Self::ChildType>,
slot: &S,
)
fn set_child( self: RenderHandle<Self>, app: &mut App, child: Option<Self::ChildType>, slot: &S, )
Dart’s _setChild.
Sourcefn move_child(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
slot: &S,
old_slot: &S,
)
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".