debugConnection method

Future<DebugConnection> debugConnection(
  1. AppConnection appConnection
)

Creates a debug connection for the given app connection.

Returns a DebugConnection that wraps the appropriate debug services based on the connection type (WebSocket or Chrome-based).

Implementation

Future<DebugConnection> debugConnection(AppConnection appConnection) async {
  if (!_enableDebugging) throw StateError('Debugging is not enabled.');

  if (_useDwdsWebSocketConnection) {
    return await _devHandler.createDebugConnectionForWebSocket(appConnection);
  } else {
    return await _devHandler.createDebugConnectionForChrome(appConnection);
  }
}