Skip to content
pubscout

multiple_stream_builder

3.0.2, released 4 years ago by levizitting.com

Flutter widgets to replace multiple nested StreamBuilder widgets with a single builder.

WASM-ready
$ flutter pub add multiple_stream_builder
Source repository

What it does

Provides a set of StreamBuilder widgets (e.g., StreamBuilder3) that accept multiple streams and tuples of initial data, allowing you to handle multiple streams simultaneously in a single builder function instead of nesting multiple StreamBuilder widgets.

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

Use it when

  • You need to listen to multiple streams within the same part of your UI.
  • You want to avoid deeply nested StreamBuilder boilerplate.

Skip it when

  • You are using a state management solution that already handles multiple streams or reactive state cleanly.
  • You only need to listen to a single stream.

Strengths

  • Eliminates deeply nested StreamBuilder code.
  • Supports up to 15 streams using dedicated builders.
  • Simple declarative usage matching standard Flutter APIs.

Weaknesses

  • Relies on custom tuple types instead of native collections for streams and initial data.
  • Limited to stream handling; not a full state management solution.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
Widget build(BuildContext context) {
  return StreamBuilder3<int, int, int>(
    streams: StreamTuple3(stream1, stream2, stream3),
    initialData: InitialDataTuple3(0, 0, 0),
    builder: (context, snapshots) {
      return Text(
        'stream1: ${snapshots.snapshot1.data} - stream2: ${snapshots.snapshot2.data} - stream3: ${snapshots.snapshot3.data}',
      );
    },
  );
}

Alternatives

Packages that do the same job and could replace multiple_stream_builder.