updateMetadata<T> method

void updateMetadata<T>(
  1. T data
)

Update Metadata of the room

Implementation

void updateMetadata<T>(T data) {
  try {
    if (state == RoomStates.closed ||
        state == RoomStates.failed ||
        state == RoomStates.left) {
      logger.e('❌ Cannot Update Metadata, You have not joined the room yet');
      return;
    }

    final metadata = json.encode(data);

    this.metadata = metadata;

    socket.publish(Request_Request.updateRoomMetadata, {
      'metadata': metadata,
    });
  } catch (error) {
    logger.e('❌ Error Updating Metadata | error: $error');
  }
}