dropWhileList<T> function

List<T> dropWhileList<T>(
  1. bool dropFunction(
    1. T sub
    ),
  2. Iterable<T> it
)

Drop first n elements that meet criteria.

Implementation

List<T> dropWhileList<T>(bool Function(T sub) dropFunction, Iterable<T> it) {
  if (it.isEmpty) {
    return [];
  }
  List<T> l = List.from(it);
  for (int i = 0; i < l.length; i++) {
    if (!dropFunction(l[i])) {
      return l.sublist(i, l.length);
    }
  }
  return [];
}