fromWire function

Stream<DecodedWireEvent> fromWire(
  1. Stream<Map<String, dynamic>> frames, {
  2. AgentWireProtocol? protocol,
})

Decodes a received frame stream. Every frame yields one DecodedWireEvent: KnownWireEvent for native events, RequestWireEvent for host-interaction requests, UnknownWireEvent for unknown kinds (the passthrough keeps the stream alive, E3).

Implementation

Stream<DecodedWireEvent> fromWire(
  Stream<Map<String, dynamic>> frames, {
  AgentWireProtocol? protocol,
}) {
  final wire = protocol ?? AgentWireProtocol();
  return frames.map(wire.decodeEvent);
}