MessageSender.fromJson constructor

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

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();
  }
}