pub struct AnnotatedRegion<T> {
pub key: Option<KeyRef>,
pub value: Rc<T>,
pub sized: bool,
pub child: WidgetRef,
}Expand description
Annotates a region of the layer tree with a value.
See also:
Layer::find, for how this value is retrieved.AnnotatedRegionLayer, the layer pushed into the recording.
Fields§
§key: Option<KeyRef>§value: Rc<T>A value which can be retrieved using
AnyLayer::find.
Dart’s T value; it is shared rather than copied so the recording can carry it.
sized: boolIf false, the layer pushed into the tree will not be provided with a size.
An AnnotatedRegionLayer with a size checks
that the offset provided in AnyLayer::find
is within the bounds, returning None otherwise.
child: WidgetRefImplementations§
Source§impl<T: PartialEq + Debug + 'static> AnnotatedRegion<T>
impl<T: PartialEq + Debug + 'static> AnnotatedRegion<T>
Sourcepub fn new<K>(child: impl IntoWidget<K>, value: T) -> AnnotatedRegion<T>
pub fn new<K>(child: impl IntoWidget<K>, value: T) -> AnnotatedRegion<T>
Creates a new annotated region to insert value into the layer tree.
sized defaults to true and controls whether the annotated region will
clip its child.
Sourcepub fn key(self, key: KeyRef) -> AnnotatedRegion<T>
pub fn key(self, key: KeyRef) -> AnnotatedRegion<T>
Dart AnnotatedRegion(key:).
Sourcepub fn sized(self, sized: bool) -> AnnotatedRegion<T>
pub fn sized(self, sized: bool) -> AnnotatedRegion<T>
Dart AnnotatedRegion(sized:).
Trait Implementations§
Source§impl<T: Debug> Debug for AnnotatedRegion<T>
impl<T: Debug> Debug for AnnotatedRegion<T>
Source§impl<T: PartialEq + Debug + 'static> RenderObjectWidget for AnnotatedRegion<T>
impl<T: PartialEq + Debug + 'static> RenderObjectWidget for AnnotatedRegion<T>
Source§type RenderObject = RenderAnnotatedRegion<T>
type RenderObject = RenderAnnotatedRegion<T>
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<RenderAnnotatedRegion<T>>,
)
fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderAnnotatedRegion<T>>, )
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.Source§impl<T: PartialEq + Debug + 'static> SingleChildRenderObjectWidget for AnnotatedRegion<T>
impl<T: PartialEq + Debug + 'static> SingleChildRenderObjectWidget for AnnotatedRegion<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for AnnotatedRegion<T>
impl<T> !Send for AnnotatedRegion<T>
impl<T> !Sync for AnnotatedRegion<T>
impl<T> !UnwindSafe for AnnotatedRegion<T>
impl<T> Forget for AnnotatedRegion<T>
impl<T> Freeze for AnnotatedRegion<T>
impl<T> Move for AnnotatedRegion<T>
impl<T> Unpin for AnnotatedRegion<T>
impl<T> UnsafeUnpin for AnnotatedRegion<T>where
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<T> is !null: UnsafeUnpin,
PhantomData<RcInner<T>>: 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.