takeWhile abstract method

IntStream takeWhile(
  1. bool predicate(
    1. int
    )
)

Returns a stream consisting of the elements taken from this stream until the predicate returns false.

Example

final lessThan5 = IntStream.range(1, 10)
    .takeWhile((n) => n < 5);

Implementation

IntStream takeWhile(bool Function(int) predicate);