MainMessage class

Inheritance

Constructors

MainMessage()

Properties

arguments List<String>
The arguments list from the Intl.message call.
getter/setter pairoverride-getter
attributeNames List<String>
The parameters that the Intl.message call may provide.
no setteroverride
dartMessageName String
Return the message name we would use for this when doing Dart code generation, e.g. "Intl.plural".
no setteroverride
description String?
The description provided in the Intl.message call.
getter/setter pair
endPosition int
The position in the source at which this message ends.
getter/setter pair
examples Map<String, dynamic>
The examples from the Intl.message call
getter/setter pairoverride-getter
hashCode int
The hash code for this object.
no setterinherited
hasName bool
Does this message have an assigned name.
no setter
icuMessageName String
Return the name of the message type, as it will be generated into an ICU-type format. e.g. choice, select
no setteroverride
id String?
A placeholder for any other identifier that the translation format may want to use.
getter/setter pair
jsonTranslations Map<String, Object>
getter/setter pair
locale String?
The locale argument from the Intl.message call
getter/setter pair
meaning String?
A field to disambiguate two messages that might have exactly the same text. The two messages will also need different names, but this can be used by machine translation tools to distinguish them.
getter/setter pair
messagePieces List<Message>
All the pieces of the message. When we go to print, these will all be expanded appropriately. The exact form depends on what we're printing it for See expanded, toCode.
getter/setter pair
name String
If the message was not given a name, we use the entire message string as the name.
getter/setter pairoverride-getter
parent Message?
All Messages except a MainMessage are contained inside some parent, terminating at an Intl.message call which supplies the arguments we use for variable substitutions.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skip bool
Whether extraction skip outputting this message.
getter/setter pair
sourcePosition int
The position in the source at which this message starts.
getter/setter pair
translations Map<String, String>
When generating code, we store translations for each locale associated with the original message.
getter/setter pair

Methods

addPieces(List<Object> messages) → void
addTranslation(String locale, Message translated) → void
Record the translation for this message in the given locale, after suitably escaping it.
checkArgs(NamedExpression? args, List<String> parameterNames) bool
Verify that the args argument matches the method parameters and isn't, e.g. passing string names instead of the argument values.
inherited
checkValidity(MethodInvocation node, List arguments, String? outerName, FormalParameterList outerArgs, {bool nameAndArgsGenerated = false, bool examplesRequired = false}) String?
Verify that this looks like a correct Intl.message invocation.
override
escapeAndValidateString(String value) String
Escape the string for use in generated Dart code.
inherited
expanded([Function f = _nullTransform]) String
Return the full message, with any interpolation expressions transformed by f and all the results concatenated. The chunk argument to f may be either a String, an int or an object representing a more complex message entity. See messagePieces.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toCode() String
Return a string representation of this message for use in generated Dart code.
override
toCodeForLocale(String locale, String name) String
Generate code for this message, expecting it to be part of a map keyed by name with values the function that calls Intl.message.
toJson() Object
Return a JSON-storable representation of this message which can be interpolated at runtime.
override
toJsonForLocale(String locale) → dynamic
Return a JSON string representation of this message.
toOriginalCode({bool includeDesc = true, dynamic includeExamples = true}) String
Create a string that will recreate this message, optionally including the compile-time only information desc and examples.
toString() String
A string representation of this object.
override
turnInterpolationBackIntoStringForm(Message message, dynamic chunk) → dynamic
validate() → void
Verify that a constructed message is valid.
inherited
validateDescription() → void

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String attributeName) → dynamic
The AST node will have the attribute names as strings, so we translate between those and the fields of the class.
override
operator []=(String attributeName, dynamic value) → void
The AST node will have the attribute names as strings, so we translate between those and the fields of the class.
override