Skip to main content

heartinz_essentials 3.4.0 copy "heartinz_essentials: ^3.4.0" to clipboard
heartinz_essentials: ^3.4.0 copied to clipboard

Essentials provides a set of ready-to-use tools for calculations, date and time manipulations, currency conversions, and GST (tax) computations, making it an all-in-one solution for developers

3.4.0 - 2026-07-28 #

Added #

  • New discount module (ported from @heartinz/finance): distributeDiscount() spreads a total discount across a list of amounts proportionally using the largest-remainder method, and distributeDiscountToItems() distributes a discount across line items and reconciles rounding drift, with model_discount.dart result models.

3.3.0 - 2026-07-17 #

Added #

  • New returnPrice module (ported from @heartinz/finance): getReturnAmountList() calculates the return price breakdown for a return line item, and getReturnGrandTotal() calculates the grand total for the total return amounts, with model_return_price_calculations.dart result models.

3.2.0 - 2026-07-13 #

Added #

  • New offer module (ported from @heartinz/finance): getOfferAmount() calculates the final amount after applying an offer percent discount, and getOfferPercent() calculates the discount percent between an mrp and salePrice.

3.1.2 - 2026-06-12 #

Added #

  • New purchase module: getPurchaseAmount() and getPurchaseGrandTotal() for purchase price/tax breakdowns, with model_purchase.dart result models.
  • Exported normalizeConfig() for normalizing UnitConfig instances.

Fixed #

  • _capitalize in GrandTotal now capitalizes each word instead of only the first.

3.1.0 - 2026-04-21 #

Added #

  • Organized Essentials class with sub-modules for better API structure:
    • calc module: calculateGrandTotal(), gstCalculate(), findGstAmountSplit()
    • currency module: toCurrency(), toSubunit()
    • date module: All date/time operations (displayIso(), toTimeZone(), etc.)
    • unit module: Unit conversion operations (toPrimaryQuantity(), toSecondaryQuantity(), toPrimaryUnitPrice(), toSecondaryUnitPrice())
  • New unit conversion functions following unit_new_reference.js specification
  • Price conversion functions for unit transformations

Changed #

  • Refactored API structure: All functions now accessible via sub-modules (e.g., essentials.calc.calculateGrandTotal())
  • Updated UnitConfig to support optional secondary units
  • Enhanced unit conversion with proper validation and normalization

Breaking Changes #

  • Direct access to functions has changed. Use sub-module pattern instead:
    • Old: essentials.calculateGrandTotal()
    • New: essentials.calc.calculateGrandTotal()

3.0.0 - 2024-12-16 #

Added #

3.1.1 - 2026-04-27 #

Fixed #

  • Ensure unitScale accepts Decimal and avoid assertion on non-terminating divisions by using scaleOnInfinitePrecision where needed.

  • Adjusted unit conversion examples and tests to pass Decimal values.

  • Minor precision/rounding fixes in gst and unit calculations.

  • New Split Function

Fixed #

  • Fixed bugs related to date handling.
  • Corrected rounding errors during calculations.
  • Removed unwanted exports
1
likes
120
points
34
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Essentials provides a set of ready-to-use tools for calculations, date and time manipulations, currency conversions, and GST (tax) computations, making it an all-in-one solution for developers

Repository (GitHub)

License

MIT (license)

Dependencies

decimal, intl, number_to_words, timezone

More

Packages that depend on heartinz_essentials