RealtimeClientFrame.fromJson constructor

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

Implementation

factory RealtimeClientFrame.fromJson(Map<String, Object?> json) =>
    switch (json['type'] as String) {
      'hello' => RealtimeHello.fromJson(json),
      'subscribe' => RealtimeSubscribe.fromJson(json),
      'subscribeRecord' => RealtimeSubscribeRecord.fromJson(json),
      'unsubscribe' => RealtimeUnsubscribe.fromJson(json),
      'resume' => RealtimeResume.fromJson(json),
      'refreshAccessToken' => RealtimeRefreshAccessToken.fromJson(json),
      final other => throw FormatException(
        'Unknown RealtimeClientFrame.type: $other',
      ),
    };