pub trait SingleChildRenderObjectWidget: RenderObjectWidgetwhere
Self::RenderObject: RenderObjectWithChildMixin,{
// Required method
fn child(&self) -> Option<&WidgetRef>;
// Provided method
fn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElement
where Self: Sized { ... }
}Expand description
A superclass for RenderObjectWidgets that configure RenderObject subclasses that have
a single child slot.
The render object assigned to this widget should make use of
RenderObjectWithChildMixin to implement a single child model.
Required Methods§
Provided Methods§
Sourcefn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElementwhere
Self: Sized,
fn create_element(&self, app: &mut App, this: WidgetRef) -> AnyElementwhere
Self: Sized,
Creates the element that manages this widget’s child.
Dart’s createElement; a widget whose element has bodies of its own
(SingleChildScrollView’s viewport) overrides it with an element that implements
SingleChildRenderObjectElementBase.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".