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(FullPosit.byPosit(
      posit: stack.last,
      bottom: _getBottom(key: stack.last.key),
      actions: _getActions(key: stack.last.key),
      floatingAction: _getFloating(key: stack.last.key),
    ));

    return false;
  }

  return true;
}