fromJson static method

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

Implementation

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

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

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

    default:
      return null;
  }
}