Watch.fromJson constructor

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

Implementation

factory Watch.fromJson(Map<String, Object?> json) {
  return Watch(
    type: json[r'type'] as String? ?? '',
    watcher: WatchUser.fromJson(
        json[r'watcher'] as Map<String, Object?>? ?? const {}),
    contentId: (json[r'contentId'] as num?)?.toInt() ?? 0,
  );
}