popUntil method

void popUntil(
  1. bool test(
    1. T stackElement
    )
)

Implementation

void popUntil(bool Function(T stackElement) test) {
  while (glance() != null && !test(glance() as T)) {
    pop();
  }
}