simple_durations 2.1.1
simple_durations: ^2.1.1 copied to clipboard
Extensions on int to easily create Durations directly from ints. Can be used for units as small as planck time all the way up to galactic years and beyond.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
2.1.1 - 2026-01-18 #
Fixed #
- Internal linting issues and code consistency across
lib,test, andexample. - Added missing
@overridetoPlanckDuration.compareTo.
2.1.0 - 2026-01-17 #
2.0.0 - 2024-12-30 #
Note: This is a major version bump due to a breaking change in the API. The PlanckDuration constructor is no longer const to support runtime validation. If you were using const PlanckDuration(...), you'll need to remove the const keyword. This release also includes many new features and improvements.
Added #
toString()method toPlanckDurationclass for better debugging and display- Arithmetic operators (
+,-,*,/) toPlanckDurationclass - Comparison operators (
<,>,<=,>=) toPlanckDurationclass toDuration()method to convertPlanckDurationtoDuration- Input validation for negative values in
PlanckDurationconstructor SimpleDurationsDoubleextension fordoublevalues with fractional precision- Comprehensive test coverage for new features and edge cases
- Enhanced documentation with examples
- Performance benchmarks in
benchmark/benchmark.dart - CHANGELOG.md for tracking version history
Changed #
- Improved error messages for negative value validation
- Enhanced
PlanckDurationconstructor with validation - Updated
PlanckDurationto acceptdoubleforplancksparameter for better precision - Code formatting improvements to comply with Dart linting standards
- Updated README.md with Buy Me a Coffee support section
- SDK requirement set to
^3.8.0for maximum compatibility (supports Dart 3.8.0 and above)
Fixed #
- Better precision handling in double extensions
- Improved toString() display logic for various time units
- All linting issues resolved (line length, code formatting)
Breaking Changes #
PlanckDurationconstructor is no longerconst(removed to support runtime validation). Code usingconst PlanckDuration(...)will need to remove theconstkeyword.
1.0.7 2024-01-XX #
Added #
- Initial release with comprehensive time duration extensions
- Support for planck time and sub-microsecond precision
- Extensive collection of time units from planck time to galactic years
PlanckDurationclass for ultra-precise time measurements- Support for both integer and fractional time values
Features #
- Extensions on
intfor creatingDurationobjects - Custom
PlanckDurationclass for sub-microsecond precision - Over 50 different time units supported
- Comprehensive test coverage
- Well-documented API with examples