LiveSpaceData.fromJson constructor

LiveSpaceData.fromJson(
  1. Map<String, dynamic> map
)

Implementation

factory LiveSpaceData.fromJson(Map<String, dynamic> map) {
  return LiveSpaceData(
    host: AdminPeer.fromJson(map['host']),
    speakers: (map['speakers'] as List<dynamic>)
        .map((adminPeer) => AdminPeer.fromJson(adminPeer))
        .toList(),
    listeners: (map['listeners'] as List<dynamic>)
        .map((listenerPeer) => ListenerPeer.fromJson(listenerPeer))
        .toList(),
  );
}