ChatMemberStatus.fromJson constructor

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

Implementation

factory ChatMemberStatus.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case ChatMemberStatusCreator.CONSTRUCTOR:
      return ChatMemberStatusCreator.fromJson(json);
    case ChatMemberStatusAdministrator.CONSTRUCTOR:
      return ChatMemberStatusAdministrator.fromJson(json);
    case ChatMemberStatusMember.CONSTRUCTOR:
      return ChatMemberStatusMember.fromJson(json);
    case ChatMemberStatusRestricted.CONSTRUCTOR:
      return ChatMemberStatusRestricted.fromJson(json);
    case ChatMemberStatusLeft.CONSTRUCTOR:
      return ChatMemberStatusLeft.fromJson(json);
    case ChatMemberStatusBanned.CONSTRUCTOR:
      return ChatMemberStatusBanned.fromJson(json);
    default:
      return const ChatMemberStatus();
  }
}