ConnectionState.fromJson constructor

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

Parses whichever ConnectionState subtype the JSON describes.

Implementation

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