PollType.fromJson constructor

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

a PollType return type can be :

Implementation

factory PollType.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case PollTypeRegular.CONSTRUCTOR:
      return PollTypeRegular.fromJson(json);
    case PollTypeQuiz.CONSTRUCTOR:
      return PollTypeQuiz.fromJson(json);
    default:
      return const PollType();
  }
}