EventSource.fromJson constructor

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

Creates a EventSource from JSON data.

Implementation

factory EventSource.fromJson(Map<String, dynamic> json) {
  final tempComponentJson = json['component'];
  final tempHostJson = json['host'];

  final String? tempComponent = tempComponentJson;
  final String? tempHost = tempHostJson;

  return EventSource(
    component: tempComponent,
    host: tempHost,
  );
}