pub struct CustomSingleChildLayout {
pub key: Option<KeyRef>,
pub delegate: Rc<dyn SingleChildLayoutDelegate>,
pub child: Option<WidgetRef>,
}Expand description
A widget that defers the layout of its single child to a delegate.
The delegate can determine the layout constraints for the child and can decide where to position the child. The delegate can also determine the size of the parent, but the size of the parent cannot depend on the size of the child.
See also:
SingleChildLayoutDelegate, which controls the layout of the child.Align, which sizes itself based on its child’s size and positions the child according to anAlignmentvalue.FractionallySizedBox, which sizes its child based on a fraction of its own size and positions the child according to anAlignmentvalue.CustomMultiChildLayout, which uses a delegate to position multiple children.- The catalog of layout widgets.
Fields§
§key: Option<KeyRef>§delegate: Rc<dyn SingleChildLayoutDelegate>The delegate that controls the layout of the child.
child: Option<WidgetRef>Implementations§
Source§impl CustomSingleChildLayout
impl CustomSingleChildLayout
Sourcepub fn new(
delegate: Rc<dyn SingleChildLayoutDelegate>,
) -> CustomSingleChildLayout
pub fn new( delegate: Rc<dyn SingleChildLayoutDelegate>, ) -> CustomSingleChildLayout
Creates a custom single child layout; Dart’s optional named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> CustomSingleChildLayout
pub fn key(self, key: KeyRef) -> CustomSingleChildLayout
Dart CustomSingleChildLayout(key:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> CustomSingleChildLayout
pub fn child<K>(self, child: impl IntoWidget<K>) -> CustomSingleChildLayout
Dart CustomSingleChildLayout(child:).
Trait Implementations§
Source§impl Debug for CustomSingleChildLayout
impl Debug for CustomSingleChildLayout
Source§impl RenderObjectWidget for CustomSingleChildLayout
impl RenderObjectWidget for CustomSingleChildLayout
Source§type RenderObject = RenderCustomSingleChildLayoutBox
type RenderObject = RenderCustomSingleChildLayoutBox
The render object this widget creates; Dart’s
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
Creates an instance of the
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<RenderCustomSingleChildLayoutBox>,
)
fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderCustomSingleChildLayoutBox>, )
Copies the configuration described by this widget to the given render object, which
will be of the same type as returned by this object’s
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, )
Dart’s
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
Dart’s
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), )
Dart’s
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>, )
A render object previously associated with this widget has been removed from the tree.
The given
RenderObject will be of the same type as returned by this object’s
create_render_object.Auto Trait Implementations§
impl !RefUnwindSafe for CustomSingleChildLayout
impl !Send for CustomSingleChildLayout
impl !Sync for CustomSingleChildLayout
impl !UnwindSafe for CustomSingleChildLayout
impl Forget for CustomSingleChildLayout
impl Freeze for CustomSingleChildLayoutwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn SingleChildLayoutDelegate> is !null: Freeze,
PhantomData<RcInner<dyn SingleChildLayoutDelegate>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for CustomSingleChildLayout
impl Unpin for CustomSingleChildLayout
impl UnsafeUnpin for CustomSingleChildLayoutwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn SingleChildLayoutDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SingleChildLayoutDelegate>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
impl<W> IntoWidget<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
The widget as a tree node, made where this is called: its
creation_location.