skipWhile
Skips values while a predicate returns true, then yields everything after — matches or not.
Lecture
skipWhile is takeWhile's mirror: it skips
elements as long as the predicate holds, then — the moment it hits one
that fails — switches into "yield everything" mode for good. That
switch-over is permanent: once skipWhile starts passing
values through, it never goes back to dropping, even if a later element
would also have matched.
Reach for it to strip a variable-length prefix you can't count in
advance — leading whitespace-like tokens, header rows, a warm-up period
in a metrics stream. skipWhile is the Dart-idiomatic name,
matching Iterable.skipWhile; fxdart also accepts the FxTS
spelling dropWhile — they're the same operator.
Demo 1 · Basics
Once dropping stops at 3, later matching values
(2 at the end) are kept, not dropped again:
Demo 2 · Async
Try it yourself
Exercise: skip temperatures while they stay below 25, then keep the rest.