inList static method

bool inList(
  1. String s,
  2. List<String> list,
  3. {bool ignoreCase = false}
)

Checks if the given list contains the string s

Implementation

static bool inList(String s, List<String> list, {bool ignoreCase = false}) {
  for (var l in list) {
    if (ignoreCase) {
      if (equalsIgnoreCase(s, l)) {
        return true;
      }
    } else {
      if (s == l) {
        return true;
      }
    }
  }
  return false;
}