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§
Sourcetype ChildType: ErasedRenderObject
type ChildType: ErasedRenderObject
Flutter’s ChildType: the protocol of this render object’s children.
Sourcetype ParentDataType: ContainerParentDataMixin<ChildType = Self::ChildType> + 'static
type ParentDataType: ContainerParentDataMixin<ChildType = Self::ChildType> + 'static
Flutter’s ParentDataType: the parent data this render object installs on its children.
Required Methods§
Sourcefn container_data(
self: RenderHandle<Self>,
app: &App,
) -> &ContainerRenderObjectData<Self::ChildType>
fn container_data( self: RenderHandle<Self>, app: &App, ) -> &ContainerRenderObjectData<Self::ChildType>
Mixin field access.
Sourcefn container_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut ContainerRenderObjectData<Self::ChildType>
fn container_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut ContainerRenderObjectData<Self::ChildType>
See container_data.
Provided Methods§
Sourcefn child_count(self: RenderHandle<Self>, app: &App) -> usize
fn child_count(self: RenderHandle<Self>, app: &App) -> usize
The number of children.
Sourcefn insert(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
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.
Sourcefn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
fn add(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
Append child to the end of this render object’s child list.
Sourcefn add_all(
self: RenderHandle<Self>,
app: &mut App,
children: Option<Vec<Self::ChildType>>,
)
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.
Sourcefn remove(self: RenderHandle<Self>, app: &mut App, child: Self::ChildType)
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.
Sourcefn remove_all(self: RenderHandle<Self>, app: &mut App)
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.
Sourcefn move_child(
self: RenderHandle<Self>,
app: &mut App,
child: Self::ChildType,
after: Option<Self::ChildType>,
)
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.
Sourcefn did_attach(
self: RenderHandle<Self>,
app: &mut App,
owner: Handle<PipelineOwner>,
)
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.
Sourcefn did_detach(self: RenderHandle<Self>, app: &mut App)
fn did_detach(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s detach override: detaches every child in the list.
Sourcefn redepth_children(self: RenderHandle<Self>, app: &mut App)
fn redepth_children(self: RenderHandle<Self>, app: &mut App)
Flutter’s redepthChildren: walks the child list.
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), )
Flutter’s visitChildren: walks the child list.
Sourcefn first_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
fn first_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
The first child in the child list.
Sourcefn last_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
fn last_child(self: RenderHandle<Self>, app: &App) -> Option<Self::ChildType>
The last child in the child list.
Sourcefn child_before(
self: RenderHandle<Self>,
app: &App,
child: Self::ChildType,
) -> Option<Self::ChildType>
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.
Sourcefn child_after(
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>
The next child after the given child in the child list.
Sourcefn children_as_list(self: RenderHandle<Self>, app: &App) -> Vec<Self::ChildType>
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".