isValidVariableIdentifier function

bool isValidVariableIdentifier(
  1. String identifer
)

Returns true this is a valid variable name, that is, a dart identifier which is not a reserved keyword.

Identifiers can start with a letter or underscore (_), followed by any combination of those characters plus digits.

See https://dart.dev/language

Implementation

bool isValidVariableIdentifier(String identifer) =>
    !invalidIdentifiers.contains(identifer) && isValidIdentifier(identifer);