Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Implement RestartableTimer.tick #89

Merged
merged 2 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.0

* Implement `RestartableTimer.tick`.

## 2.2.0

* Add `then` to `CancelableOperation`.
Expand Down
12 changes: 6 additions & 6 deletions lib/src/restartable_timer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class RestartableTimer implements Timer {
_timer.cancel();
}

/// The number of durations preceding the most recent timer event on the most
/// recent countdown.
///
/// Calls to [reset] will also reset the tick so subsequent tick values may
/// not be strictly larger than previous values.
@override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do remove the @override while you are here. We don't use @override in package:async. (This is the only instance of @override in the entire package).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can for now.

I think we should strongly consider adding them everywhere in this package and enabling the lint. We implement a lot of interfaces and it's really nice to be able to see quickly which are the new methods.

// TODO: Dart 2.0 requires this method to be implemented.
// See https://github.com/dart-lang/sdk/issues/31664
// ignore: override_on_non_overriding_getter
int get tick {
throw UnimplementedError("tick");
}
int get tick => _timer.tick;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: async
version: 2.2.0
version: 2.3.0

description: Utility functions and classes related to the 'dart:async' library.
author: Dart Team <misc@dartlang.org>
Expand Down