toJson method

Map<String, dynamic> toJson()

Convert to JSON for transmission/storage

Implementation

Map<String, dynamic> toJson() => {
      'connectionId': connectionId,
      'remotePeerId': remotePeerId,
      'connectionType': connectionType,
      'establishedAt': establishedAt.toIso8601String(),
      if (outerConnectionId != null) 'outerConnectionId': outerConnectionId,
      if (sessionId != null) 'sessionId': sessionId,
      if (relayPeerId != null) 'relayPeerId': relayPeerId,
      if (hopStreamId != null) 'hopStreamId': hopStreamId,
      if (transportConnectionId != null)
        'transportConnectionId': transportConnectionId,
    };