clock 1.1.0-nullsafety
clock: ^1.1.0-nullsafety copied to clipboard
A fakeable wrapper for dart:core clock APIs
1.1.0-nullsafety #
- Update to null safety.
1.0.1 #
- Update to lowercase Dart core library constants.
1.0.0 #
This release contains the Clock class that was defined in quiver. It's
backwards-compatible with the quiver version, and mostly
backwards-compatible with the old version of the clock package.
New Features #
-
A top-level
clockfield has been added that provides a defaultClockimplementation. It can be controlled by thewithClock()function. It should generally be used in preference to manual dependency-injection, since it will work with thefake_asyncpackage. -
A
Clock.stopwatch()method has been added that creates aStopwatchthat uses the clock as its source of time.
Changes Relative to clock 0.1 #
-
The top-level
newgetter andgetStopwatch()methods are deprecated.clock.new()andclock.stopwatch()should be used instead. -
Clock.getStopwatch()is deprecated.Clock.stopwatch()should be used instead. -
The
isFinalargument towithClock()is deprecated. -
new Clock()now takes an optional positional argument that returns the current time as aDateTimeinstead of its old arguments. -
Clock.now()is now a method rather than a getter.