MessageSender.fromJson constructor
a MessageSender return type can be :
Implementation
factory MessageSender.fromJson(Map<String, dynamic> json) {
switch (json["@type"]) {
case MessageSenderUser.CONSTRUCTOR:
return MessageSenderUser.fromJson(json);
case MessageSenderChat.CONSTRUCTOR:
return MessageSenderChat.fromJson(json);
default:
return const MessageSender();
}
}