finishSession method

void finishSession({
  1. VoidCallback? popPageIfAlive,
})

统一结束:

  • 小窗在 → 关小窗
  • 大屏在 → 调 popPageIfAlive(业务用 pop 强关,绕过 PopScope)
  • 然后清理

Implementation

void finishSession({VoidCallback? popPageIfAlive}) {
  final cb = _sessionDispose;
  _sessionDispose = null;

  if (_overlay != null) {
    _overlay!.remove();
    _overlay = null;
  } else {
    popPageIfAlive?.call();
  }

  _teardownEventStream();
  resetSession();
  cb?.call();
}