hasRepeated<T> static method

bool hasRepeated<T>(
  1. List<T> list
)

CHecks if there are subsequent repeating items.

Implementation

static bool hasRepeated<T>(List<T> list) {
  for (var i = 1; i < list.length; i++) {
    if (list[i - 1] == list[i]) {
      return true;
    }
  }
  return false;
}