pub trait SemanticsAnnotationsMixin: RenderObject {
Show 23 methods
// Required methods
fn semantics_annotations_data(
self: RenderHandle<Self>,
app: &App,
) -> &SemanticsAnnotationsData;
fn semantics_annotations_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut SemanticsAnnotationsData;
// Provided methods
fn init_semantics_annotations(
self: RenderHandle<Self>,
app: &mut App,
properties: Rc<SemanticsProperties>,
container: bool,
explicit_child_nodes: bool,
exclude_semantics: bool,
block_user_actions: bool,
locale_for_subtree: Option<Locale>,
text_direction: Option<TextDirection>,
) { ... }
fn properties(
self: RenderHandle<Self>,
app: &App,
) -> Rc<SemanticsProperties> { ... }
fn set_properties(
self: RenderHandle<Self>,
app: &mut App,
value: Rc<SemanticsProperties>,
) { ... }
fn container(self: RenderHandle<Self>, app: &App) -> bool { ... }
fn set_container(self: RenderHandle<Self>, app: &mut App, value: bool) { ... }
fn explicit_child_nodes(self: RenderHandle<Self>, app: &App) -> bool { ... }
fn set_explicit_child_nodes(
self: RenderHandle<Self>,
app: &mut App,
value: bool,
) { ... }
fn exclude_semantics(self: RenderHandle<Self>, app: &App) -> bool { ... }
fn set_exclude_semantics(
self: RenderHandle<Self>,
app: &mut App,
value: bool,
) { ... }
fn block_user_actions(self: RenderHandle<Self>, app: &App) -> bool { ... }
fn set_block_user_actions(
self: RenderHandle<Self>,
app: &mut App,
value: bool,
) { ... }
fn locale_for_subtree(self: RenderHandle<Self>, app: &App) -> Option<Locale> { ... }
fn set_locale_for_subtree(
self: RenderHandle<Self>,
app: &mut App,
value: Option<Locale>,
) { ... }
fn update_attributed_fields(
self: RenderHandle<Self>,
app: &mut App,
value: &SemanticsProperties,
) { ... }
fn attributed_label(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString> { ... }
fn attributed_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString> { ... }
fn attributed_increased_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString> { ... }
fn attributed_decreased_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString> { ... }
fn attributed_hint(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString> { ... }
fn text_direction(
self: RenderHandle<Self>,
app: &App,
) -> Option<TextDirection> { ... }
fn set_text_direction(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextDirection>,
) { ... }
}Expand description
A mixin for RenderObjects that want to annotate the SemanticsNode
for their subtree.
Required Methods§
Sourcefn semantics_annotations_data(
self: RenderHandle<Self>,
app: &App,
) -> &SemanticsAnnotationsData
fn semantics_annotations_data( self: RenderHandle<Self>, app: &App, ) -> &SemanticsAnnotationsData
Mixin field access.
Sourcefn semantics_annotations_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut SemanticsAnnotationsData
fn semantics_annotations_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut SemanticsAnnotationsData
Provided Methods§
Sourcefn init_semantics_annotations(
self: RenderHandle<Self>,
app: &mut App,
properties: Rc<SemanticsProperties>,
container: bool,
explicit_child_nodes: bool,
exclude_semantics: bool,
block_user_actions: bool,
locale_for_subtree: Option<Locale>,
text_direction: Option<TextDirection>,
)
fn init_semantics_annotations( self: RenderHandle<Self>, app: &mut App, properties: Rc<SemanticsProperties>, container: bool, explicit_child_nodes: bool, exclude_semantics: bool, block_user_actions: bool, locale_for_subtree: Option<Locale>, text_direction: Option<TextDirection>, )
Initializes the semantics annotations for this mixin.
Sourcefn properties(self: RenderHandle<Self>, app: &App) -> Rc<SemanticsProperties>
fn properties(self: RenderHandle<Self>, app: &App) -> Rc<SemanticsProperties>
All of the SemanticsProperties for this SemanticsAnnotationsMixin.
Sourcefn set_properties(
self: RenderHandle<Self>,
app: &mut App,
value: Rc<SemanticsProperties>,
)
fn set_properties( self: RenderHandle<Self>, app: &mut App, value: Rc<SemanticsProperties>, )
Sets properties.
Sourcefn container(self: RenderHandle<Self>, app: &App) -> bool
fn container(self: RenderHandle<Self>, app: &App) -> bool
If ‘container’ is true, this RenderObject will introduce a new
node in the semantics tree. Otherwise, the semantics will be
merged with the semantics of any ancestors.
Whether descendants of this RenderObject can add their semantic information
to the SemanticsNode introduced by this configuration is controlled by
explicit_child_nodes.
Sourcefn set_container(self: RenderHandle<Self>, app: &mut App, value: bool)
fn set_container(self: RenderHandle<Self>, app: &mut App, value: bool)
Sets container.
Sourcefn explicit_child_nodes(self: RenderHandle<Self>, app: &App) -> bool
fn explicit_child_nodes(self: RenderHandle<Self>, app: &App) -> bool
Whether descendants of this RenderObject are allowed to add semantic
information to the SemanticsNode annotated by this widget.
When set to false descendants are allowed to annotate SemanticsNodes of
their parent with the semantic information they want to contribute to the
semantic tree.
When set to true the only way for descendants to contribute semantic
information to the semantic tree is to introduce new explicit
SemanticsNodes to the tree.
This setting is often used in combination with
SemanticsConfiguration.isSemanticBoundary to create semantic boundaries
that are either writable or not for children.
Sourcefn set_explicit_child_nodes(
self: RenderHandle<Self>,
app: &mut App,
value: bool,
)
fn set_explicit_child_nodes( self: RenderHandle<Self>, app: &mut App, value: bool, )
Sets explicit_child_nodes.
Sourcefn exclude_semantics(self: RenderHandle<Self>, app: &App) -> bool
fn exclude_semantics(self: RenderHandle<Self>, app: &App) -> bool
Whether descendants of this RenderObject should have their semantic
information ignored.
When this flag is set to true, all child semantics nodes are ignored.
This can be used as a convenience for cases where a child is wrapped in
an ExcludeSemantics widget and then another Semantics widget.
Sourcefn set_exclude_semantics(self: RenderHandle<Self>, app: &mut App, value: bool)
fn set_exclude_semantics(self: RenderHandle<Self>, app: &mut App, value: bool)
Sets exclude_semantics.
Sourcefn block_user_actions(self: RenderHandle<Self>, app: &App) -> bool
fn block_user_actions(self: RenderHandle<Self>, app: &App) -> bool
Whether to block user interactions for the semantics subtree.
Setting this true prevents user from activating pointer related
SemanticsActions, such as SemanticsAction::TAP or
SemanticsAction::LONG_PRESS.
Sourcefn set_block_user_actions(self: RenderHandle<Self>, app: &mut App, value: bool)
fn set_block_user_actions(self: RenderHandle<Self>, app: &mut App, value: bool)
Sets block_user_actions.
Sourcefn locale_for_subtree(self: RenderHandle<Self>, app: &App) -> Option<Locale>
fn locale_for_subtree(self: RenderHandle<Self>, app: &App) -> Option<Locale>
The Locale for the semantics subtree.
Setting this to null will inherit locale from ancestor semantics node.
Sourcefn set_locale_for_subtree(
self: RenderHandle<Self>,
app: &mut App,
value: Option<Locale>,
)
fn set_locale_for_subtree( self: RenderHandle<Self>, app: &mut App, value: Option<Locale>, )
Sets locale_for_subtree.
Sourcefn update_attributed_fields(
self: RenderHandle<Self>,
app: &mut App,
value: &SemanticsProperties,
)
fn update_attributed_fields( self: RenderHandle<Self>, app: &mut App, value: &SemanticsProperties, )
Flutter’s _updateAttributedFields.
Sourcefn attributed_label(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString>
fn attributed_label( self: RenderHandle<Self>, app: &App, ) -> Option<AttributedString>
Dart’s _attributedLabel: the label describeSemanticsConfiguration will report.
Sourcefn attributed_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString>
fn attributed_value( self: RenderHandle<Self>, app: &App, ) -> Option<AttributedString>
Dart’s _attributedValue.
Sourcefn attributed_increased_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString>
fn attributed_increased_value( self: RenderHandle<Self>, app: &App, ) -> Option<AttributedString>
Dart’s _attributedIncreasedValue.
Sourcefn attributed_decreased_value(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString>
fn attributed_decreased_value( self: RenderHandle<Self>, app: &App, ) -> Option<AttributedString>
Dart’s _attributedDecreasedValue.
Sourcefn attributed_hint(
self: RenderHandle<Self>,
app: &App,
) -> Option<AttributedString>
fn attributed_hint( self: RenderHandle<Self>, app: &App, ) -> Option<AttributedString>
Dart’s _attributedHint.
Sourcefn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
fn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
If non-null, sets the SemanticsNode.textDirection semantic to the given
value.
This must not be null if SemanticsProperties::attributed_label,
SemanticsProperties::attributed_hint,
SemanticsProperties::attributed_value,
SemanticsProperties::attributed_increased_value, or
SemanticsProperties::attributed_decreased_value are not null.
Sourcefn set_text_direction(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextDirection>,
)
fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: Option<TextDirection>, )
Sets text_direction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".