Skip to content
pubscout

stream_duration

4.2.2, released 3 years ago by farhanfadila.site

A Dart package for countdown, countup, and infinite countup streams.

WASM-ready
$ flutter pub add stream_duration
Source repository

What it does

Provides a StreamDuration class to easily manage time durations as streams. It supports countdowns, countups from an initial duration, and infinite countups.

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

Use it when

  • You need to display a countdown timer in your app.
  • You need to track elapsed time with a countup timer stream.

Skip it when

  • You are looking for a complete audio/video streaming solution.

Strengths

  • Supports countdown, countup, and countup infinity out of the box.
  • Provides play, pause, resume, and duration adjustment controls.
  • Zero external dependencies.

Weaknesses

  • Limited documentation outside of basic README examples.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
final streamDuration = StreamDuration(
  config: StreamDurationConfig(
    autoPlay: true,
    countDownConfig: CountDownConfig(
      duration: Duration(seconds: 10),
    ),
    onDone: () => print('Stream Done 👍'),
  ),
);

streamDuration.durationLeft.listen((event) {
  print(event.inSeconds);
});

Alternatives

Packages that do the same job and could replace stream_duration.