Message class abstract

Getter for the translation of a String for the locale in a given BuildContext.

Implementers

Constructors

Message()
const
Message.date(DateTime value, {String? pattern})
factory
Message.fallback(String? text, Message fallback)
If the given text is null, it falls back to the provided fallback instance.
factory
Message.joined(List<Message> parts, {Message? separator})
Concatenate the text of multiple Message instances together. If separator is not null, it's localized value will be inserted between each element.
const
factory
Message.number(num value, {NumberFormatType pattern})
factory
Message.static(String text)
Returns the value of text regardless of the current locale.
const
factory

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
resolve(BuildContext context) String
Retrieve the localized string for the given context
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

getString(BuildContext context, Object obj) String
Return the resolved text if obj is a Message instance, otherwise the result of toString is returned.