readVersion static method
Reads the protocol version out of a decoded frame.
A frame without the field comes from a build that predates it, which by definition speaks firstProtocolVersion.
Implementation
static int readVersion(Map<String, dynamic> json) =>
json['protocolVersion'] as int? ?? firstProtocolVersion;