pub struct MergeSemantics {
pub key: Option<KeyRef>,
pub child: Option<WidgetRef>,
}Expand description
A widget that merges the semantics of its descendants.
Causes all the semantics of the subtree rooted at this node to be merged into one node in the semantics tree. For example, if you have a widget with a Text node next to a checkbox widget, this could be used to merge the label from the Text node with the “checked” semantic state of the checkbox into a single node that had both the label and the checked state. Otherwise, the label would be presented as a separate feature than the checkbox, and the user would not be able to be sure that they were related.
Be aware that if two nodes in the subtree have conflicting semantics, the result may be nonsensical. For example, a subtree with a checked checkbox and an unchecked checkbox will be presented as checked. All the labels will be merged into a single string (with newlines separating each label from the other). If multiple nodes in the merged subtree can handle semantic gestures, the first one in tree order will be the one to receive the callbacks.
Fields§
§key: Option<KeyRef>§child: Option<WidgetRef>Implementations§
Source§impl MergeSemantics
impl MergeSemantics
Sourcepub fn new() -> MergeSemantics
pub fn new() -> MergeSemantics
Creates a widget that merges the semantics of its descendants; Dart’s named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> MergeSemantics
pub fn key(self, key: KeyRef) -> MergeSemantics
Dart MergeSemantics(key:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> MergeSemantics
pub fn child<K>(self, child: impl IntoWidget<K>) -> MergeSemantics
Dart MergeSemantics(child:).
Trait Implementations§
Source§impl Debug for MergeSemantics
impl Debug for MergeSemantics
Source§impl Default for MergeSemantics
impl Default for MergeSemantics
Source§impl RenderObjectWidget for MergeSemantics
impl RenderObjectWidget for MergeSemantics
Source§type RenderObject = RenderMergeSemantics
type RenderObject = RenderMergeSemantics
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 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 update_render_object(
&self,
app: &mut App,
context: BuildContext,
render_object: RenderHandle<Self::RenderObject>,
)
fn update_render_object( &self, app: &mut App, context: BuildContext, render_object: RenderHandle<Self::RenderObject>, )
create_render_object. Read moreSource§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 MergeSemantics
impl !Send for MergeSemantics
impl !Sync for MergeSemantics
impl !UnwindSafe for MergeSemantics
impl Forget for MergeSemantics
impl Freeze for MergeSemantics
impl Move for MergeSemantics
impl Unpin for MergeSemantics
impl UnsafeUnpin for MergeSemanticswhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: 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
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>
creation_location.