BonsoirBroadcastEvent.fromJson constructor
Creates a new Bonsoir broadcast event from the given JSON map.
Implementation
BonsoirBroadcastEvent.fromJson(Map<String, dynamic> json)
: this(
type: BonsoirBroadcastEventType.values.firstWhere(
(type) => type.id == json['id'],
orElse: () => BonsoirBroadcastEventType.unknown,
),
service: json.containsKey('service')
? BonsoirService.fromJson(
Map<String, dynamic>.from(json['service']))
: null,
);