MainMessage class

Inheritance
Implementers

Constructors

MainMessage()

Properties

arguments List<String>
The arguments list from the Intl.message call.
read / write, override-getter
attributeNames List<String>
The parameters that the Intl.message call may provide.
read-only, override
dartMessageName String
Return the message name we would use for this when doing Dart code generation, e.g. "Intl.plural".
read-only, override
description String
The description provided in the Intl.message call.
read / write
endPosition int
The position in the source at which this message ends.
read / write
examples Map<String, dynamic>
The examples from the Intl.message call
read / write, override-getter
hashCode int
The hash code for this object. [...]
read-only, inherited
hasName bool
Does this message have an assigned name.
read-only
icuMessageName String
Return the name of the message type, as it will be generated into an ICU-type format. e.g. choice, select
read-only, override
id String
A placeholder for any other identifier that the translation format may want to use.
read / write
jsonTranslations Map<String, Object>
read / write
locale String
The locale argument from the Intl.message call
read / write
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.
read / write
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.
read / write
name String
If the message was not given a name, we use the entire message string as the name.
read / write, override-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.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
skip bool
Whether extraction skip outputting this message. [...]
read / write
sourcePosition int
The position in the source at which this message starts.
read / write
translations Map<String, String>
When generating code, we store translations for each locale associated with the original message.
read / write

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 non-existent 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