isValidSymbolChar method

bool isValidSymbolChar(
  1. String? ch,
  2. bool allowDigits,
  3. bool inBrackets
)

Implementation

bool isValidSymbolChar(String? ch, bool allowDigits, bool inBrackets) {
  if (ch == null) {
    return false;
  } else {
    return (allowDigits &&
            ch.compareTo('0') >= 0 &&
            ch.compareTo('9') <= 0) ||
        (ch.compareTo('a') >= 0 && ch.compareTo('z') <= 0) ||
        (ch.compareTo('A') >= 0 && ch.compareTo('Z') <= 0) ||
        ch == '[' ||
        ch == ']' ||
        ch == '%' ||
        ch == '*' ||
        ch == '^' ||
        ch == "'" ||
        ch == '"' ||
        ch == '_' ||
        (inBrackets && ch == '.');
  }
}