fromJson static method

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

Implementation

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

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

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

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

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

    default:
      return null;
  }
}