fromJson static method

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

Implementation

static PollType? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case PollTypeQuiz.constructor:
      return PollTypeQuiz.fromJson(json);

    case PollTypeRegular.constructor:
      return PollTypeRegular.fromJson(json);

    default:
      return null;
  }
}