checkValidity method

String? checkValidity(
  1. MethodInvocation node,
  2. List arguments,
  3. String? outerName,
  4. FormalParameterList outerArgs, {
  5. bool nameAndArgsGenerated = false,
  6. bool examplesRequired = false,
})
override

Verify that this looks like a correct Intl.message invocation.

Implementation

String? checkValidity(MethodInvocation node, List arguments,
    String? outerName, FormalParameterList outerArgs,
    {bool nameAndArgsGenerated: false, bool examplesRequired: false}) {
  if (arguments.first is! StringLiteral) {
    return "Intl.message messages must be string literals";
  }

  return super.checkValidity(node, arguments, outerName, outerArgs,
      nameAndArgsGenerated: nameAndArgsGenerated,
      examplesRequired: examplesRequired);
}