Skip to content
pubscout

stream_channel

2.1.4, released 2 years ago by tools.dart.dev

An abstraction for two-way communication channels based on the Dart Stream class.

WASM-readyQuiet but busy
$ flutter pub add stream_channel
Source repository

What it does

Exposes the StreamChannel interface representing a two-way communication channel, exposing a Stream for receiving and a StreamSink for sending data. It helps abstract communication logic away from underlying protocols and provides utilities for managing two-way communications.

AI-written summary of version 2.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to abstract two-way communication protocols away from your core logic.
  • You are building or testing systems using WebSocket or Isolate connections.

Skip it when

  • You do not need a standardized Stream and StreamSink abstraction for bi-directional communication.

Strengths

  • Clean abstraction for two-way communication channels based on standard Dart Streams.
  • Includes helpful utilities and transformers for dealing with stream channels.

Weaknesses

  • Limited to what is supported by standard Dart Streams and Sinks.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:stream_channel/stream_channel.dart';

// Example usage concept from documentation:
// StreamChannel channel = ...;

Alternatives

Packages that do the same job and could replace stream_channel.

Works with

Packages commonly used together with stream_channel: ones it builds on, ones built on it, and its own family.