stream_duration 2.0.4 icon indicating copy to clipboard operation
stream_duration: ^2.0.4 copied to clipboard

A dart package for stream duration, support countdown, countup, and countup infinity.

cover #

A dart package for stream duration, support countdown, countup, and countup infinity.


Example Countdown #

import 'package:stream_duration/stream_duration.dart';


void main() {
  /// Countdown
  var streamDuration = StreamDuration(Duration(seconds: 10), onDone: () {
    print('Stream Done 👍');
  });

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

Output Countdown #

output


Example Count Up #

import 'package:stream_duration/stream_duration.dart';


void main() {
   /// Countup
  var streamDurationUp = StreamDuration(Duration(seconds: 10), onDone: () {
    print('Stream Done 👍');
  }, countUp: true);

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

Output Count Up #

output up


Example Count Up Infinity #

import 'package:stream_duration/stream_duration.dart';


void main() {
  /// Countup Infinity
  var streamDurationUpInfinity =
      StreamDuration(Duration(seconds: 10), countUp: true, infinity: true);

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

Output Count Up Infinity #

output infinity


🚧 Maintener #

account avatar
Farhan Fadila
📫 How to reach me: farhan.fadila1717@gmail.com

❤️ Suport Maintener #

badge paypal badge linktree

5
likes
130
pub points
82%
popularity

Publisher

unverified uploader

A dart package for stream duration, support countdown, countup, and countup infinity.

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

More

Packages that depend on stream_duration