FFXThreadPreviewEvent.fromJson constructor

FFXThreadPreviewEvent.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory FFXThreadPreviewEvent.fromJson(Map<String, Object?> json) =>
    switch (json['type'] as String) {
      'screen-updated' => FFXThreadPreviewScreenUpdatedEvent.fromJson(json),
      'screen-shot' => FFXThreadPreviewScreenShotEvent.fromJson(json),
      'screen-removed' => FFXThreadPreviewScreenRemovedEvent.fromJson(json),
      final other => throw FormatException(
        'Unknown FFXThreadPreviewEvent.type: $other',
      ),
    };