dropWhile function

List dropWhile(
  1. List array,
  2. Function predicate
)

Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

Implementation

List dropWhile(List array, Function predicate) {
  return array.skipWhile((element) => !predicate(element)).toList();
}