fromJson static method

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

Implementation

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

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

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

    default:
      return null;
  }
}