Poll.fromJson constructor

Poll.fromJson(
  1. dynamic json
)

Implementation

factory Poll.fromJson(json) {
  return Poll(
    id: json['id'],
    text: json["text"],
    title: json["title"],
    score: json["score"],
    descendants: json["descendants"],
    by: json['by'],
    type: json['type'],
    parent: json['parent'],
    time: json['time'],
    dead: json['dead'] ?? false,
    deleted: json['deleted'] ?? false,
    kids: json['kids']?.cast<int>() ?? [],
    parts: json['parts']?.cast<int>() ?? [],
  );
}