countdown 0.0.3 countdown: ^0.0.3 copied to clipboard
Countdown is countdown with pause/resume controls
// Copyright (c) 2015, Benjamin NGUYEN. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
library countdown.example;
import 'package:countdown/countdown.dart';
import 'dart:async';
main() {
CountDown cd = new CountDown(new Duration(seconds : 10));
var sub = cd.stream.listen(null);
sub.onData((Duration d) {
print(d);
});
sub.onDone(() {
print("done");
});
new Timer(new Duration(milliseconds: 4000), () {
sub.pause();
});
new Timer(new Duration(milliseconds: 4800), () {
sub.resume();
});
}