RealtimeEvent.fromJson constructor

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

Implementation

factory RealtimeEvent.fromJson(Map<String, Object?> json) => RealtimeEvent(
  channel: json['channel'] as String,
  seq: (json['seq'] as num).toInt(),
  previousSeq: (json['previousSeq'] as num).toInt(),
  eventId: json['eventId'] as String,
  recordId: json['recordId'] as String,
  version: (json['version'] as num).toInt(),
  changeType: RealtimeEventChangeType.fromWire(json['changeType'] as String),
  occurredAt: json['occurredAt'] as String,
  subscriptions: (json['subscriptions'] as List<Object?>)
      .map(
        (item) => RealtimeEventSubscription.fromJson(
          (item as Map).cast<String, Object?>(),
        ),
      )
      .toList(),
  postImage: json['postImage'] == null
      ? null
      : (json['postImage'] as Map).cast<String, Object?>(),
);