pub struct CustomMultiChildLayout {
pub key: Option<KeyRef>,
pub delegate: Rc<dyn MultiChildLayoutDelegate>,
pub children: Vec<WidgetRef>,
}Expand description
A widget that uses a delegate to size and position multiple children.
The delegate can determine the layout constraints for each child and can decide where to position each child. The delegate can also determine the size of the parent, but the size of the parent cannot depend on the sizes of the children.
CustomMultiChildLayout is appropriate when there are complex relationships between the
size and positioning of multiple widgets. For simple cases, such as aligning a widget to one
or another edge, the Stack widget is more appropriate.
Each child must be wrapped in a LayoutId widget to identify the widget for the delegate.
See also:
MultiChildLayoutDelegate, for details about how to control the layout of the children.Stack, which arranges children relative to the edges of the container.- The catalog of layout widgets.
Fields§
§key: Option<KeyRef>§delegate: Rc<dyn MultiChildLayoutDelegate>The delegate that controls the layout of the children.
children: Vec<WidgetRef>Implementations§
Source§impl CustomMultiChildLayout
impl CustomMultiChildLayout
Sourcepub fn new(delegate: Rc<dyn MultiChildLayoutDelegate>) -> CustomMultiChildLayout
pub fn new(delegate: Rc<dyn MultiChildLayoutDelegate>) -> CustomMultiChildLayout
Creates a custom multi-child layout; Dart’s optional named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> CustomMultiChildLayout
pub fn key(self, key: KeyRef) -> CustomMultiChildLayout
Dart CustomMultiChildLayout(key:).
Sourcepub fn children(
self,
children: impl IntoIterator<Item = WidgetRef>,
) -> CustomMultiChildLayout
pub fn children( self, children: impl IntoIterator<Item = WidgetRef>, ) -> CustomMultiChildLayout
Dart CustomMultiChildLayout(children:).
Trait Implementations§
Source§impl Debug for CustomMultiChildLayout
impl Debug for CustomMultiChildLayout
Source§impl RenderObjectWidget for CustomMultiChildLayout
impl RenderObjectWidget for CustomMultiChildLayout
Source§type RenderObject = RenderCustomMultiChildLayoutBox
type RenderObject = RenderCustomMultiChildLayoutBox
covariant RenderObject parameter type.Source§fn create_render_object(
&self,
app: &mut App,
_context: BuildContext,
) -> AnyRenderObject
fn create_render_object( &self, app: &mut App, _context: BuildContext, ) -> AnyRenderObject
RenderObject class that this widget represents, using the
configuration described by this widget. Read moreSource§fn update_render_object(
&self,
app: &mut App,
_context: BuildContext,
render_object: RenderHandle<RenderCustomMultiChildLayoutBox>,
)
fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderCustomMultiChildLayoutBox>, )
create_render_object. Read moreSource§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
toStringShort, for a widget that names itself apart from its type, as
SizedBox.expand does; see Widget::to_string_short.Source§fn debug_visit_onstage_children(
&self,
app: &App,
children: &[AnyElement],
visitor: &mut dyn FnMut(AnyElement),
)
fn debug_visit_onstage_children( &self, app: &App, children: &[AnyElement], visitor: &mut dyn FnMut(AnyElement), )
debugVisitOnstageChildren of the element this widget makes, for a widget whose
Dart element subclass overrides it only to hide children (_OffstageElement,
_IndexedStackElement): calls visitor for each of children, in order, that is
onstage. Waft’s generic single- and multi-child elements stand in for those subclasses
and ask their widget here; an element of a widget’s own overrides
Element::debug_visit_onstage_children instead.Source§fn did_unmount_render_object(
&self,
app: &mut App,
render_object: RenderHandle<Self::RenderObject>,
)
fn did_unmount_render_object( &self, app: &mut App, render_object: RenderHandle<Self::RenderObject>, )
RenderObject will be of the same type as returned by this object’s
create_render_object.Auto Trait Implementations§
impl !RefUnwindSafe for CustomMultiChildLayout
impl !Send for CustomMultiChildLayout
impl !Sync for CustomMultiChildLayout
impl !UnwindSafe for CustomMultiChildLayout
impl Forget for CustomMultiChildLayout
impl Freeze for CustomMultiChildLayoutwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn MultiChildLayoutDelegate> is !null: Freeze,
PhantomData<RcInner<dyn MultiChildLayoutDelegate>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Rc<dyn Widget>>: Freeze,
impl Move for CustomMultiChildLayout
impl Unpin for CustomMultiChildLayout
impl UnsafeUnpin for CustomMultiChildLayoutwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn MultiChildLayoutDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn MultiChildLayoutDelegate>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<MultiChildRenderObjectKind> for Wwhere
W: MultiChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: ContainerRenderObjectMixin,
impl<W> IntoWidget<MultiChildRenderObjectKind> for Wwhere
W: MultiChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: ContainerRenderObjectMixin,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.