IcuMessage class

Properties

hashCode int
The hash code for this object.
no setterinherited
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
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

extractPlaceholders(String message) Set<String>
All placeholder variable names referenced in message, recursing into plural/select branches. The same name appearing twice is returned once.
extractPluralCategories(String message) List<String>?
Categories used in the first (outermost) {var, plural, …} expression in message, in source order. Returns null if no plural expression is found.
flattenToOther(String message, {String? keyHint}) String
Collapse every ICU plural / select / selectordinal expression in message to its other branch, recursively, and strip type/format suffixes from typed placeholders ({amount, number, currency}{amount}). Literal text, simple {placeholder} tokens, and quoted runs are preserved verbatim. This is the flat-json lowering rule — see dialect/spec/flat-json.md.
hasExpressions(String message) bool
True if message contains any ICU expression ({name} or {var, …, …}). False for plain strings (no {} at all, or only escaped braces).
hasPluralOrSelect(String message) bool
True if message contains any plural, select, or selectordinal expression at any nesting depth — i.e. anything flat-json would collapse. Used to count lossy events for the sync hint.