looksLikeIntlMessage method

bool looksLikeIntlMessage(
  1. MethodInvocation node
)

Return true if node matches the pattern we expect for Intl.message()

Implementation

bool looksLikeIntlMessage(MethodInvocation node) {
  const validNames = const ["message", "plural", "gender", "select"];
  if (!validNames.contains(node.methodName.name)) return false;
  final target = node.target;
  if (target is SimpleIdentifier) {
    return target.token.toString() == 'Intl';
  } else if (target is PrefixedIdentifier) {
    return target.identifier.token.toString() == 'Intl';
  }
  return false;
}