Skip to main content

ContainerParentDataMixin

Trait ContainerParentDataMixin 

Source
pub trait ContainerParentDataMixin: ParentData {
    type ChildType: Copy + PartialEq;

    // Required methods
    fn container_parent_data(&self) -> &ContainerParentData<Self::ChildType>;
    fn container_parent_data_mut(
        &mut self,
    ) -> &mut ContainerParentData<Self::ChildType>;

    // Provided methods
    fn previous_sibling(&self) -> Option<Self::ChildType> { ... }
    fn set_previous_sibling(&mut self, value: Option<Self::ChildType>) { ... }
    fn next_sibling(&self) -> Option<Self::ChildType> { ... }
    fn set_next_sibling(&mut self, value: Option<Self::ChildType>) { ... }
    fn detach(&mut self) { ... }
}
Expand description

Parent data to support a doubly-linked list of children.

The children can be traversed using next_sibling or previous_sibling, which can be called on the parent data of the render objects obtained via crate::ContainerRenderObjectMixin::first_child or crate::ContainerRenderObjectMixin::last_child.

Flutter’s ContainerParentDataMixin. The links live in a ContainerParentData field.

Required Associated Types§

Source

type ChildType: Copy + PartialEq

The type-erased handle of a child in the list. AnyRenderBox for a box container.

Required Methods§

Provided Methods§

Source

fn previous_sibling(&self) -> Option<Self::ChildType>

The previous sibling in the parent’s child list.

Source

fn set_previous_sibling(&mut self, value: Option<Self::ChildType>)

Source

fn next_sibling(&self) -> Option<Self::ChildType>

The next sibling in the parent’s child list.

Source

fn set_next_sibling(&mut self, value: Option<Self::ChildType>)

Source

fn detach(&mut self)

Clear the sibling pointers.

The body of Flutter’s detach override; call it from ParentData::detach.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§