popRoot<T> method

bool popRoot<T>([
  1. T? result
])

Implementation

bool popRoot<T>([T? result]) {
  if (rootStack.length <= 1) {
    return false;
  }

  final lastRootIndex = _stack.indexOf(rootStack.last);

  _stack.removeAt(lastRootIndex).didPop(result);

  notifyListeners();

  return true;
}