popUntil method

void popUntil(
  1. Predicate<T?> test
)

Pops to value of given test. All next values are removed from stack.

Implementation

void popUntil(Predicate<T?> test) {
  int index = _stack.indexWhere(test);

  if (index > -1) {
    _stack.removeRange(index, _stack.length);
  }

  _notifyParent();
}