UserType.fromJson constructor

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

Implementation

factory UserType.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case UserTypeRegular.CONSTRUCTOR:
      return UserTypeRegular.fromJson(json);
    case UserTypeDeleted.CONSTRUCTOR:
      return UserTypeDeleted.fromJson(json);
    case UserTypeBot.CONSTRUCTOR:
      return UserTypeBot.fromJson(json);
    case UserTypeUnknown.CONSTRUCTOR:
      return UserTypeUnknown.fromJson(json);
    default:
      return const UserType();
  }
}