countdown 0.1.0 copy "countdown: ^0.1.0" to clipboard
countdown: ^0.1.0 copied to clipboard

Countdown is countdown with pause/resume controls

example/countdown.dart

// 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 = CountDown(Duration(seconds: 10));
  var sub = cd.stream.listen(null);

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

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

  Timer(Duration(milliseconds: 4000), () {
    sub.pause();
  });

  Timer(Duration(milliseconds: 4800), () {
    sub.resume();
  });
}
7
likes
30
pub points
78%
popularity

Publisher

unverified uploader

Countdown is countdown with pause/resume controls

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

More

Packages that depend on countdown