Skip to main content

ContainerRenderObjectMixin

Trait ContainerRenderObjectMixin 

Source
pub trait ContainerRenderObjectMixin: RenderObject {
    type ChildType: ErasedRenderObject;
    type ParentDataType: ContainerParentDataMixin<ChildType = Self::ChildType> + 'static;

Show 18 methods // Required methods fn container_data( self: RenderHandle<Self>, app: &App, ) -> &ContainerRenderObjectData<Self::ChildType>; fn container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut ContainerRenderObjectData<Self::ChildType>; // Provided methods fn child_count(self: RenderHandle<Self>, app: &App) -> usize { ... } fn insert( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, ) { ... } fn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType) { ... } fn add_all( self: RenderHandle<Self>, app: &mut App, children: Option<Vec<Self::ChildType>>, ) { ... } fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType) { ... } fn remove_all(self: RenderHandle<Self>, app: &mut App) { ... } fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, ) { ... } 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 first_child( self: RenderHandle<Self>, app: &App, ) -> Option<Self::ChildType> { ... } fn last_child( self: RenderHandle<Self>, app: &App, ) -> Option<Self::ChildType> { ... } fn child_before( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType> { ... } fn child_after( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType> { ... } fn children_as_list( self: RenderHandle<Self>, app: &App, ) -> Vec<Self::ChildType> { ... }
}
Expand description

Generic mixin for render objects with a list of children.

Provides a child model for a render object that has a doubly-linked list of children.

ParentDataType stores parent container data on its child render objects. It must be a ContainerParentDataMixin, which provides the interface for visiting children. This data is populated by the setup_parent_data implemented by the render object using this mixin.

Flutter’s ContainerRenderObjectMixin. Its two type arguments are the associated types ChildType and ParentDataType.

Required Associated Types§

Source

type ChildType: ErasedRenderObject

Flutter’s ChildType: the protocol of this render object’s children.

Source

type ParentDataType: ContainerParentDataMixin<ChildType = Self::ChildType> + 'static

Flutter’s ParentDataType: the parent data this render object installs on its children.

Required Methods§

Source

fn container_data( self: RenderHandle<Self>, app: &App, ) -> &ContainerRenderObjectData<Self::ChildType>

Mixin field access.

Source

fn container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut ContainerRenderObjectData<Self::ChildType>

Provided Methods§

Source

fn child_count(self: RenderHandle<Self>, app: &App) -> usize

The number of children.

Source

fn insert( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )

Insert child into this render object’s child list after the given child.

If after is None, then this inserts the child at the start of the list, and the child becomes the new first_child.

Source

fn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)

Append child to the end of this render object’s child list.

Source

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

Add all the children to the end of this render object’s child list.

Source

fn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)

Remove this child from the child list.

Requires the child to be present in the child list.

Source

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

Remove all their children from this render object’s child list.

More efficient than removing them individually.

Source

fn move_child( self: RenderHandle<Self>, app: &mut App, child: Self::ChildType, after: Option<Self::ChildType>, )

Move the given child in the child list to be after another child.

Dart’s move. More efficient than removing and re-adding the child. Requires the child to already be in the child list at some position. Pass None for after to move the child to the start of the child list.

Source

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

The body of Flutter’s attach override: attaches every child in the list.

Source

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

The body of Flutter’s detach override: detaches every child in the list.

Source

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

Flutter’s redepthChildren: walks the child list.

Source

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

Flutter’s visitChildren: walks the child list.

Source

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

The first child in the child list.

Source

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

The last child in the child list.

Source

fn child_before( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType>

The previous child before the given child in the child list.

Source

fn child_after( self: RenderHandle<Self>, app: &App, child: Self::ChildType, ) -> Option<Self::ChildType>

The next child after the given child in the child list.

Source

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

Returns a list containing the children of this render object.

Dart’s RenderBoxContainerDefaultsMixin.getChildrenAsList, useful for any container.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl ContainerRenderObjectMixin for RenderCustomMultiChildLayoutBox

Source§

impl ContainerRenderObjectMixin for RenderEditable

Source§

impl ContainerRenderObjectMixin for RenderFlex

Source§

impl ContainerRenderObjectMixin for RenderIndexedStack

Source§

impl ContainerRenderObjectMixin for RenderParagraph

Source§

impl ContainerRenderObjectMixin for RenderShrinkWrappingViewport

Source§

impl ContainerRenderObjectMixin for RenderSliverFixedExtentList

Source§

impl ContainerRenderObjectMixin for RenderSliverGrid

Source§

impl ContainerRenderObjectMixin for RenderSliverList

Source§

impl ContainerRenderObjectMixin for RenderSliverVariedExtentList

Source§

impl ContainerRenderObjectMixin for RenderStack

Source§

impl ContainerRenderObjectMixin for RenderViewport

Source§

impl ContainerRenderObjectMixin for RenderWrap