getLobbyPeerMetadata method

Map<String, dynamic> getLobbyPeerMetadata(
  1. String peerId
)

Implementation

Map<String, dynamic> getLobbyPeerMetadata(String peerId) {
  final lobbyPeer = _lobbyPeers[peerId];

  Map<String, dynamic> metadata = <String, dynamic>{};
  String? lobbyMetaData = lobbyPeer?['metadata'];
  if (lobbyPeer?['metadata'] != null && lobbyMetaData != null) {
    metadata = Map<String, dynamic>.from(jsonDecode(lobbyMetaData));
  }
  return {
    'peerId': peerId,
    'metadata': metadata,
  };
}