looksLikePluralOrGender method

bool looksLikePluralOrGender(
  1. Expression expression
)

Return true if node matches the pattern for plural or gender message.

Implementation

bool looksLikePluralOrGender(Expression expression) {
  if (expression is! MethodInvocation) return false;
  final node = expression;
  if (!["plural", "gender", "select"].contains(node.methodName.name)) {
    return false;
  }
  if (!(node.target is SimpleIdentifier)) return false;
  SimpleIdentifier target = node.target as SimpleIdentifier;
  return target.token.toString() == "Intl";
}