isContiguous<T> static method
Implementation
static bool isContiguous<T>(List<T> list, List<T> values) {
if (list.isEmpty) return false;
List<int> indices = list.map((e) => values.indexOf(e)).toList();
indices.sort();
for (int i = 0; i < indices.length - 1; i++) {
if (indices[i + 1] - indices[i] != 1) {
return false;
}
}
return true;
}