Skip to main content

MultiChildLayoutChildren

Struct MultiChildLayoutChildren 

Source
pub struct MultiChildLayoutChildren { /* private fields */ }
Expand description

The children a MultiChildLayoutDelegate lays out, keyed by their MultiChildLayoutParentData::id.

Dart’s MultiChildLayoutDelegate._idToChild and, in debug builds, its _debugChildrenNeedingLayout. RenderCustomMultiChildLayoutBox builds one from its child list and hands it to MultiChildLayoutDelegate::perform_layout.

Implementations§

Source§

impl MultiChildLayoutChildren

Source

pub fn has_child(&self, child_id: &ChildLayoutId) -> bool

True if a non-None child was provided for the specified id.

Call this from MultiChildLayoutDelegate::perform_layout to determine which children are available, if the child list might vary.

This cannot be called from MultiChildLayoutDelegate::get_size as the size is not allowed to depend on the children.

Source

pub fn layout_child( &mut self, app: &mut App, child_id: &ChildLayoutId, constraints: BoxConstraints, ) -> Size

Ask the child to update its layout within the limits specified by the constraints parameter. The child’s size is returned.

Call this from MultiChildLayoutDelegate::perform_layout to lay out each child. Every child must be laid out using this function exactly once each time MultiChildLayoutDelegate::perform_layout is called.

§Panics

If there is no child with child_id, or, in a debug build, if that child was already laid out during this call.

Source

pub fn position_child( &self, app: &mut App, child_id: &ChildLayoutId, offset: Offset, )

Specify the child’s origin relative to this origin.

Call this from MultiChildLayoutDelegate::perform_layout to position each child. If you do not call this for a child, its position will remain unchanged. Children initially have their position set to (0,0), i.e. the top left of the RenderCustomMultiChildLayoutBox.

§Panics

If there is no child with child_id.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>