MTextRole enum

A semantic type role, so a widget follows each platform's own scale instead of hand-guessed point sizes.

Maps to SwiftUI's Font cases on iOS and to a matching sp table on Android. The two platforms have different scales by design, so the roles line up while the exact sizes do not — that is the point of naming the role rather than the number.

An explicit size still wins: the role sets the type, size overrides it.

Note Mosaic pins .dynamicTypeSize(.large) on iOS, so a role gives you the scale's proportions without accessibility text scaling breaking a layout whose space the OS fixed.

Inheritance
Available extensions

Values

title → const MTextRole

The one number or word a tile exists to show.

const MTextRole('title', 22)
headline → const MTextRole

A section heading above supporting detail.

const MTextRole('headline', 16)
body → const MTextRole

Ordinary content.

const MTextRole('body', 14)
callout → const MTextRole

Content that should sit slightly quieter than body.

const MTextRole('callout', 13)
caption → const MTextRole

Labels, units, timestamps.

const MTextRole('caption', 12)
captionSmall → const MTextRole

The smallest legible label.

const MTextRole('caption2', 11)

Properties

androidSp → int
The Android size in sp. Android has no equivalent semantic scale that RemoteViews can reference, so the role resolves to a concrete size.
final
hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
swiftFont → String
The SwiftUI Font case name.
final

Methods

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

Operators

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

Constants

values → const List<MTextRole>
A constant List of the values in this enum, in order of their declaration.