simple_durations 2.1.1 copy "simple_durations: ^2.1.1" to clipboard
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, and example.
  • Added missing @override to PlanckDuration.compareTo.

2.1.0 - 2026-01-17 #

Added #

  • Comparable interface implementation for PlanckDuration class, enabling easy sorting.

Fixed #

  • Precision loss when creating PlanckDuration from fractional double values (e.g., 1.5.nanoseconds). Calculations now use full double precision instead of rounding to the nearest integer.

2.0.1 - 2025-11-30 #

Fixed #

  • removed redundant buy me a coffee button

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 to PlanckDuration class for better debugging and display
  • Arithmetic operators (+, -, *, /) to PlanckDuration class
  • Comparison operators (<, >, <=, >=) to PlanckDuration class
  • toDuration() method to convert PlanckDuration to Duration
  • Input validation for negative values in PlanckDuration constructor
  • SimpleDurationsDouble extension for double values 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 PlanckDuration constructor with validation
  • Updated PlanckDuration to accept double for plancks parameter 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.0 for 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 #

  • PlanckDuration constructor is no longer const (removed to support runtime validation). Code using const PlanckDuration(...) will need to remove the const keyword.

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
  • PlanckDuration class for ultra-precise time measurements
  • Support for both integer and fractional time values

Features #

  • Extensions on int for creating Duration objects
  • Custom PlanckDuration class for sub-microsecond precision
  • Over 50 different time units supported
  • Comprehensive test coverage
  • Well-documented API with examples
1
likes
160
points
138
downloads

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on simple_durations