MSemantics class

Gives child an accessibility label, so screen readers announce something meaningful instead of reading raw values or nothing at all.

MSemantics(
  label: 'Battery 71 percent, charging',
  child: MRow([batteryIcon, MText(MBind('battery_level'))]),
)

label accepts an MBind, so it can describe live data.

excludeChildren makes the wrapper a single element and hides what is inside — useful when the children are decorative fragments that read badly one by one. Honoured on both platforms: iOS uses .accessibilityElement(children: .ignore), Android importantForAccessibility="noHideDescendants" on the wrapper.

Inheritance

Constructors

MSemantics({required Object label, required MNode child, bool excludeChildren = false})
const

Properties

child MNode
final
excludeChildren bool
final
hashCode int
The hash code for this object.
no setterinherited
label Object
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited