Package selection guidance compiled from public package information, community data, and project usage.
The clock package provides a fakeable wrapper around Dart's core clock APIs, enabling predictable and testable time handling in applications. It abstracts system time operations like DateTime.now() and Duration, allowing developers to simulate different points in time during testing. This is especially useful for unit and integration tests involving timers, scheduled tasks, or time-based logic. The package supports all major platforms and integrates seamlessly with Flutter projects.
Use cases
Testing time-dependent logic
Simulating future or past dates
Mocking system time in unit tests
Building countdown timers
Implementing delayed actions
Key features
Fakeable system time
Consistent behavior across tests
Minimal overhead
Cross-platform support
Easy integration with existing code
Suitable for
Test-driven development
Time-sensitive app features
Automated testing frameworks
Flutter apps with timers
Developers needing deterministic time behavior
Considerations
Not intended for production time handling
Requires explicit use of the wrapper
May need refactoring of time-dependent code
Limited to basic time operations
Best used in test environments only
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Overview
This repository is home to tooling related Dart packages. Generally, this means
packages published through the
tools.dart.dev publisher that
don't naturally belong to other topic monorepos (like
dart-lang/build,
dart-lang/test, or
dart-lang/shelf).
A client library for authenticating with a remote service via OAuth2 on behalf of a user, and making authorized HTTP requests with the user's OAuth2 credentials.