SseEvent.fromJson constructor

SseEvent.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SseEvent.fromJson(Map<String, dynamic> json) {
  final ts = json['timestamp']?.toString();
  return SseEvent(
    type: (json['type'] ?? '').toString(),
    enrollmentId: json['enrollmentId']?.toString(),
    timestamp: ts == null ? null : DateTime.tryParse(ts),
    raw: json,
  );
}