stream_transform
2.1.2, released 3 months ago by tools.dart.dev
Extension methods adding common stream transform operators
What it does
Provides a collection of Stream extension methods such as asyncMapBuffer, debounce, buffer, combineLatest, merge, and others to manipulate stream events. It focuses on asynchronous control flow and rate limiting.
AI-written summary of version 2.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need advanced stream manipulation like debouncing or buffering
- You want to avoid writing custom StreamTransformers for common patterns
- You prefer Dart‑native stream extensions over RxDart
Skip it when
- You are already using RxDart or another reactive library
- You need only basic stream operations that are already in Dart's core library
Strengths
- Pure Dart, no external dependencies
- Wide range of operators covering async mapping, buffering, debouncing, merging, etc.
- Active maintenance with recent Dart 3.4 support
Weaknesses
- No RxDart‑style operators like switchMap with leading/trailing options
- Limited documentation on edge cases
- No built‑in support for backpressure handling
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dependency in pubspec and import 'package:stream_transform/stream_transform.dart';
```dart
import 'package:stream_transform/stream_transform.dart';
final stream = Stream.fromIterable([1, 2, 3]);
final debounced = stream.debounce(const Duration(milliseconds: 100));
await for (var v in debounced) {
print(v);
}
```Alternatives
Packages that do the same job and could replace stream_transform.
- gtk
GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.
76Compare - sdp_transform
Parse and write SDP strings in Dart.
72Compare - dart_helper_utils
Dart extensions and helpers for maps, strings, collections, dates, async, and intl formatting.
80Compare - flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare
Works with
Packages commonly used together with stream_transform: ones it builds on, ones built on it, and its own family.
- stream_channelSame familyAn abstraction for two-way communication channels based on the Dart Stream class.
- build_runnerBuilt on stream_transformA build system for Dart code generation and modular compilation.
- build_daemonBuilt on stream_transformDaemon for running Dart builds in the background
- hotreloaderBuilt on stream_transformAutomatic hot code reloader for Dart projects that applies file changes to the running process.
- drift_devBuilt on stream_transformGenerates Dart database code from Drift table definitions as a dev‑dependency.
- google_maps_flutter_androidBuilt on stream_transformAndroid implementation of the google_maps_flutter plugin.
- google_maps_flutter_iosBuilt on stream_transformiOS implementation of the google_maps_flutter plugin.
- camera_android_cameraxBuilt on stream_transformAndroid camera implementation using CameraX library