EventLogDto.fromJson constructor
Parses an EventLogDto from JSON, dispatching on the type field.
Throws FormatException when type is unknown.
Implementation
factory EventLogDto.fromJson(Map<String, dynamic> json) =>
switch (json['type']) {
'change' => ChangeEventLogDto.fromJson(json),
'error' => ErrorEventLogDto.fromJson(json),
'register' => RegisterEventLogDto.fromJson(json),
'deregister' => DeregisterEventLogDto.fromJson(json),
final type => throw FormatException(
'Unknown EventLogDto type: $type',
),
};