fromJson static method

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

Implementation

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

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

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

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

    default:
      return null;
  }
}