VariableSubstitution class

Represents an interpolation of a variable value in a message. We expect this to be specified as an index into the list of variables, or else as the name of a variable that exists in arguments and we will compute the variable name or the index based on the value of the other.



VariableSubstitution(int _index, Message parent)
VariableSubstitution.named(String name, Message parent)
Create a substitution based on the name rather than the index. The name may have been used as all upper-case in the translation tool, so we save it separately and look it up case-insensitively once the parent (and its arguments) are definitely available.


arguments → dynamic
We find the arguments from the top-level MainMessage and use those to do variable substitutions. MainMessage overrides this to return the actual arguments.
read-only, inherited
examples → dynamic
We find the examples from the top-level MainMessage and use those when writing out variables. MainMessage overrides this to return the actual examples.
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
index int
name String
The name of the top-level MainMessage.
read-only, inherited
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
variableName String
The name of the variable in the parameter list of the containing function. Used when generating code for the interpolation.


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.
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/plural/gender/... invocation. [...]
escapeAndValidateString(String value) String
Escape the string for use in generated Dart code.
expanded([Function f = _nullTransform]) String
Expand this string out into a printed form. The function f will be applied to any sub-messages, allowing this to be used to generate a form suitable for a wide variety of translation file formats.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toCode() String
Return a string representation of this message for use in generated Dart code.
toJson() Object
Return a JSON-storable representation of this message which can be interpolated at runtime.
toString() String
A string representation of this object. [...]
validate() → void
Verify that a constructed message is valid. [...]


operator ==(Object other) bool
The equality operator. [...]