ChatSource.fromJson constructor

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

Implementation

factory ChatSource.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case ChatSourceMtprotoProxy.CONSTRUCTOR:
      return ChatSourceMtprotoProxy.fromJson(json);
    case ChatSourcePublicServiceAnnouncement.CONSTRUCTOR:
      return ChatSourcePublicServiceAnnouncement.fromJson(json);
    default:
      return const ChatSource();
  }
}