fromJson static method

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

Implementation

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

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

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

    default:
      return null;
  }
}