fromJson static method

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

Implementation

static MessageInfo fromJson(Map<String, dynamic> json) {
  final type = InfoType.fromJson(json['info'] as String);
  return switch (type) {
    InfoType.typingStatus => MessageInfoTyping.fromJson(json),
    InfoType.transientMessage => MessageInfoTransient.fromJson(json),
  };
}