detach static method

void detach()

卸载悬浮球与桥接输出器:球从 Overlay 移除,桥接流关闭,stream 复位 为 null。可再次 attach。

Implementation

static void detach() {
  _attachGeneration++; // 在途重试回调全部失效。
  _isAttached = false;
  hideBall();
  final bridge = _bridge;
  _bridge = null;
  _navigatorKey = null;
  if (bridge != null) {
    // 先移出分发列表再关闭:此后 collector 不再向已关闭的桥接 add 条目。
    logCollector.removeOutput(bridge);
    unawaited(bridge.dispose());
  }
}