jumpBack method

Future<bool> jumpBack()

Jump back to last key

Implementation

Future<bool> jumpBack() async {
  if (_drawerKey.currentState != null &&
      _drawerKey.currentState!.isDrawerOpen) {
    Navigator.pop(drawerContext!);
    return false;
  } else if (stack.length > 1) {
    String old = stack.isNotEmpty ? stack.last.key : null;
    if (_interface != null) {
      if (!await _interface!.onBack()) {
        return false;
      }
    }

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

    return false;
  }

  return true;
}