Skip to main content

ContainerBoxParentData

Trait ContainerBoxParentData 

Source
pub trait ContainerBoxParentData: ContainerParentDataMixin<ChildType = AnyRenderBox> {
    // Required methods
    fn box_parent_data(&self) -> &BoxParentData;
    fn box_parent_data_mut(&mut self) -> &mut BoxParentData;

    // Provided methods
    fn offset(&self) -> Offset { ... }
    fn set_offset(&mut self, value: Offset) { ... }
}
Expand description

Parent data for a RenderBox subclass that uses ContainerRenderObjectMixin.

Flutter’s ContainerBoxParentData: a convenience class that mixes ContainerParentDataMixin into a BoxParentData. Here it is the pair of accessors a container’s parent data provides, one for each half.

Required Methods§

Source

fn box_parent_data(&self) -> &BoxParentData

Mixin field access: the BoxParentData half.

ParentData::provide must answer BoxParentData with the same value, or the box protocol cannot position this child.

Source

fn box_parent_data_mut(&mut self) -> &mut BoxParentData

Provided Methods§

Source

fn offset(&self) -> Offset

The offset at which to paint the child in the parent’s coordinate system.

Source

fn set_offset(&mut self, value: Offset)

Sets offset.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§