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
impl MultiChildLayoutChildren
Sourcepub fn has_child(&self, child_id: &ChildLayoutId) -> bool
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.
Sourcepub fn layout_child(
&mut self,
app: &mut App,
child_id: &ChildLayoutId,
constraints: BoxConstraints,
) -> Size
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.
Sourcepub fn position_child(
&self,
app: &mut App,
child_id: &ChildLayoutId,
offset: Offset,
)
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.