MessageSource.fromJson constructor

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

Parses whichever MessageSource subtype the JSON describes.

Implementation

factory MessageSource.fromJson(Map<String, dynamic> json) {
  final object = tdObjectFactories[json['@type']]?.call(json);
  return object is MessageSource ? object : UndecodedMessageSource(json);
}