jumpBackToFirst method

Future<bool> jumpBackToFirst()

Jump back to first key and clean all

Implementation

Future<bool> jumpBackToFirst() async {
  String old = stack.isNotEmpty ? stack.last.key : null;

  if (stack.length > 1) {
    if (_interface != null) {
      if (!await _interface!.onBack()) {
        return false;
      }
    }
  }

  while (stack.length > 1) {
    stack.removeLast();
  }

  _onBack(old, stack.last.key);
  _fragment.sink.add(stack.last);

  return true;
}