PackageTrack
Sign in Get early access

quantity

Facilitates working with physical quantities such as angles, lengths, masses, temperatures and many others. Supports uncertainty and arbitrary precision.

5.0.0 5.0K downloads/mo #3830 most downloaded on pub.dev cooler-king/quantity

What this package is like to depend on

Last release 2 months ago

01 Jun 2026

Release timing varies

gaps range from 2 weeks to 2.8 years

Nearly every release is documented

notes for 16 of 17 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

17 releases · first in 2015

1 release in the last 12 months

see the full history below

Release timeline

17 releases · Oct 2015 to Jun 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 17
  1. 5.0.0 01 Jun 2026
    Release notes
    • Dart 3+ Modernization: Applied sealed, base, and final modifiers to Number, Quantity, and Dimensions classes. Refactored map parsing and type determination using modern pattern matching and switch expressions.
      • Fluent DX & Unit Shortcuts: Added extension getters on num and Number (e.g., 5.meters, 75.tps) and unit shortcuts (inKilometers, inTps, inCelsius).
      • Registry Decoupling & Tree-Shaking: Decoupled the physical quantity registry by registering subclasses dynamically, allowing for clean tree-shaking. Added a lightweight core entrypoint lib/quantity_core.dart.
      • JSON Serialization: Added full toJson() and fromJson() support to Quantity, Number, and Dimensions hierarchies.
      • Decimal Interoperability: Integrated the decimal package directly, introducing valueSIAsDecimal, toDecimal(), and fromDecimal(Decimal) to allow high-precision decimal operations.
      • NIST Constants Sync: Added an automated script bin/update_nist_constants.dart to synchronize physical constants and uncertainties with the official NIST CODATA table.
      • AI Readiness & Natural Language Processing:
        • Added Quantity.parse(String text) for parsing natural language physical measurements (e.g., '120 km/h', '9.8 m/s^2').
        • Added Quantity.checkDimensionalConsistency to symbolically check math formula consistency (e.g., s = u * t + 0.5 * a * t^2).
        • Added Dimensions.describe returning human-readable dimensions (e.g. 'Length^1 / Time^2').
        • Exposed structured JSON schemas (Quantity.jsonSchema) for structured LLM function calling.
      • Computational & Digital Layout Quantities:
        • Introduced Token and TokenRate classes to support modeling, parsing, and arithmetic for NLP/LLM context tracking and throughput metrics.
        • Introduced Pixel, Resolution (pixels per length), and PixelDensity (pixels per area) classes to support spatial layout scaling, screen resolution calibration (PPI/DPI/DPCM), and graphics calculations with type-safe arithmetic operators.
      • Synonym Quantity Types: Added compile-time typedef aliases and dynamic runtime name registry mapping for 19 physical quantity synonyms across 12 distinct classes (e.g. Irradiance / EnergyFluxDensity / PowerFluxDensity synonymizing HeatFluxDensity, Stress synonymizing Pressure, Work synonymizing Energy, etc.).
      • Domain Collections: Added six domain library collections under lib/domain/ to group quantity types, units, and constants commonly encountered in specific fields: radiometry, atomic_nuclear, computing, chemistry, acoustics, and fluid_dynamics. Added corresponding unit tests for each domain.
      • Algebraic Property Verification: Established property-based testing for Dimensions algebra.
      • Test Coverage Boost: Significantly expanded unit test coverage across the package. Wrote comprehensive tests for previously untested parts including the Fraction number representation class, trig functions and constants in angle_ext, fluent utility extensions on num and Number, and verified variable mappings across all 40+ extension libraries. Further expanded coverage by testing astronomical time scale conversions, range math, exception string serialization, logarithmic level operations, and dynamically generated Unit constructors/derivatives across all 75+ physical quantity classes. Raised overall repository code coverage to 90.7% (surpassing the targets of 70% and 85%).
    Open source →
  2. 4.0.0 27 Nov 2024
    Release notes
    • Breaking changes:
      • Changed some compound unit constructor names to be more descriptive.
      • Made Units.singular property non-nullable.
      • Number == operators now take an Object argument instead of dynamic,
      • Updated the minimum intl dependency to 0.19.0.
      • Added unit tests for all compound unit constructors.
        • Fixed numerous bugs in compound unit constructor logic.
      • Accounted for lower case e in number formatting/grouping.
      • Removed logging of quantity type resolution failure from inverse method.
      • Updated formatting; addressed pana suggestions.
    Open source →
  3. 3.0.2 10 Dec 2023
    Release notes
    • Update lint dependency to ^3.0.0.
    Open source →
  4. 3.0.1 24 Nov 2023
    Release notes
    • Fixed bugs in Precise class.
    Open source →
  5. 3.0.0 07 Jul 2023
    Release notes
    • Requires >= Dart SDK 3.0.
    Open source →
  6. 2.0.1 07 Jul 2023
    Release notes
    • Support for intl 0.18.
    Open source →
  7. 2.0.0 13 Mar 2021
    Release notes
    • Support for Dart 2.12, null safety.
    Open source →
  8. 1.0.0 06 Oct 2020
    Release notes
    • Requires >= Dart SDK 2.3.
      • Increased testing.
      • Number formatting; quantity text output.
      • The latest official constants.
      • TimeInstant extensions.
      • MutableQuantity.
    Open source →
  9. 0.3.0 22 Jan 2020
    Release notes
    • Relaxed intl package version dependency to >=0.15.0 <1.0.0.
    Open source →
  10. 0.2.0 06 Aug 2018

    Nothing published for this version

  11. 0.2.0+1 06 Aug 2018
    Release notes
    • Dart 2 support.
      • Stricter typing.
      • Addressed many (but not all) analyzer items.
    Open source →
  12. 0.1.4 23 Oct 2015
    Release notes
    • Added isScalar and isScalarSI to Dimensions and Quantity.
      • Extended use of type hints in dimensions for more efficient and accurate type determination during operations.
      • Generalized special handling of scalar quantities.
    Open source →
  13. 0.1.3 23 Oct 2015
    Release notes
    • Added operator == and hashCode to quantity range classes.
      • Added toTypedQuantity to MiscQuantity.
      • Changed googol constant to arbitrary precision.
      • Renamed private _dimensions constructor to _internal in quantities.
    Open source →
  14. 0.1.3+1 23 Oct 2015
    Release notes
    • Fixed CHANGELOG.md formatting.
    Open source →
  15. 0.1.2 05 Oct 2015
    Release notes
    • Precise isInteger and _limitPrecision fixes.
      • hashCode testing for quantity objects (esp. Scalar)
    Open source →
  16. 0.1.1 04 Oct 2015
    Release notes
    • Temperature, TemperatureInterval tests, tweaks, bug fixes.
    Open source →
  17. 0.1.0 03 Oct 2015
    Release notes
    • Initial version.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive