decodeJson static method
Decodes a single JSON object string into a bridge message.
Implementation
static TerminalBridgeMessage decodeJson(String source) {
final decoded = jsonDecode(source);
if (decoded is! Map<String, dynamic>) {
throw FormatException(
'Terminal bridge message must decode to a JSON object.',
);
}
return TerminalBridgeMessage.fromJson(decoded);
}