WatchEvent.fromJson constructor

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

Creates a WatchEvent from JSON data.

Implementation

factory WatchEvent.fromJson(Map<String, dynamic> json) {
  final tempObjectJson = json['object'];
  final tempTypeJson = json['type'];

  final RawExtension tempObject = RawExtension.fromJson(tempObjectJson);
  final String tempType = tempTypeJson;

  return WatchEvent(
    object: tempObject,
    type: tempType,
  );
}