countdown

Creator: coderz1093

Last updated:

0 purchases

countdown Image
countdown Images

Languages

Categories

Add to Cart

Description:

countdown

I need help to update this package because I'm not playing with dart anymore #
Countdown - yet another countdown !! #
Countdown is countdown with pause/resume controls.
Install here #
Simple use #
import 'package:countdown/countdown.dart';

main() {
CountDown cd = CountDown(Duration(seconds : 10));
var sub = cd.stream.listen(null);

// start your countdown by registering a listener
sub.onData((Duration d) {
print(d);
});

// when it finish the onDone cb is called
sub.onDone(() {
print("done");
});
}
copied to clipboard
Use with controls #
import 'package:countdown/countdown.dart';
import 'dart:async';

main() {

CountDown cd = CountDown(Duration(seconds : 10));
var sub = cd.stream.listen(null);

sub.onData((Duration d) {
print(d);
});

sub.onDone(() {
print("done");
});

/// the countdown will have 500ms delay
Timer(Duration(milliseconds: 4000), () {
sub.pause();
});
Timer(Duration(milliseconds: 4500), () {
sub.resume();
});

}
copied to clipboard
Tests #
dart test/all_test.dart
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.