PackageTrack
Sign in Get early access

async_extension

Dart async extensions, to help usage of Future, FutureOr and async methods. Also allows performance improvements when using sync and async code.

1.2.22 38K downloads/mo #1681 most downloaded on pub.dev eneural-net/async_extension

What this package is like to depend on

Last release 5 months ago

25 Mar 2026

Release timing varies

gaps range from 1 weeks to 9 months

Nearly every release is documented

notes for 38 of 38 stable releases

Nothing withdrawn

no release was ever pulled

5 years old

38 releases · first in 2021

7 releases in the last 12 months

see the full history below

Release timeline

38 releases · Jun 2021 to Mar 2026
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 38
  1. 1.2.22 25 Mar 2026
    Release notes
    • ObjectExtension<T>:
      • Added method when that returns this if a condition evaluates to true, otherwise null.
    • FutureOrExtension<T>:
      • Added method whenAsync as an async-aware version of when, returning this or null based on a condition evaluation.
    Open source →
    Release notes
    • ObjectExtension<T>:
      • Added method when that returns this if a condition evaluates to true, otherwise null.
    • FutureOrExtension<T>:
      • Added method whenAsync as an async-aware version of when, returning this or null based on a condition evaluation.
    Open source →
    Release notes

    v1.2.22 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  2. 1.2.21 11 Feb 2026
    Release notes
    • ComputeOnceCache:

      • Added callsLength getter to return the number of cached computations.
    • ComputeOnceCachedIDs:

      • Made compare field non-nullable and always initialized with a comparator (defaulting to _Comparer._defaultCompare).
      • Updated internal logic to consistently use non-null compare.
      • Improved sorting and deduplication logic in ComputeIDs constructor.
      • Enhanced computeIDs and getByIDs methods to correctly merge and order results by IDs.
      • Added detailed handling to preserve order and sorting of IDs and results.
    • ComputeIDs:

      • Made compare field non-nullable and always initialized.
      • Added checkIDsSorted method to verify internal ID ordering.
      • Simplified and unified binary search and intersection logic to rely on non-null comparator.
      • Improved intersection method to preserve input order of IDs.
      • Improved getValuesByIndexes to handle cases where values list length differs from IDs length and ensure sorted output.
      • Simplified equalsIDs to always use comparator.
    • ListIdValuePairExtension:

      • Updated binarySearchIndex and binarySearch methods to require non-null comparator argument.
    • _Comparer:

      • Updated binarySearchIndex to require non-null comparator argument.
    Open source →
    Release notes
    • ComputeOnceCache:

      • Added callsLength getter to return the number of cached computations.
    • ComputeOnceCachedIDs:

      • Made compare field non-nullable and always initialized with a comparator (defaulting to _Comparer._defaultCompare).
      • Updated internal logic to consistently use non-null compare.
      • Improved sorting and deduplication logic in ComputeIDs constructor.
      • Enhanced computeIDs and getByIDs methods to correctly merge and order results by IDs.
      • Added detailed handling to preserve order and sorting of IDs and results.
    • ComputeIDs:

      • Made compare field non-nullable and always initialized.
      • Added checkIDsSorted method to verify internal ID ordering.
      • Simplified and unified binary search and intersection logic to rely on non-null comparator.
      • Improved intersection method to preserve input order of IDs.
      • Improved getValuesByIndexes to handle cases where values list length differs from IDs length and ensure sorted output.
      • Simplified equalsIDs to always use comparator.
    • ListIdValuePairExtension:

      • Updated binarySearchIndex and binarySearch methods to require non-null comparator argument.
    • _Comparer:

      • Updated binarySearchIndex to require non-null comparator argument.
    Open source →
    Release notes

    v1.2.21

    Compare

    Choose a tag to compare

    Open source →
  3. 1.2.20 23 Jan 2026
    Release notes
    • ComputeOnce:

      • Renamed ComputeOnceCall to ComputeCall.
      • Added PosComputeCall callback invoked after computation completes, receiving success or error results.
      • Added posCompute field to invoke post-computation callback.
      • Updated resolve and resolveAsync to apply posCompute on success or error.
    • TimedComputeOnce:

      • Added support for posCompute callback.
    • Added ComputeOnceCache:

      • Caches TimedComputeOnce instances by key.
      • Supports retention duration for cached entries with automatic eviction.
      • Provides get method to retrieve or create cached computations.
    • Added ComputeOnceCachedIDs:

      • Extends ComputeOnceCache for batched computations by ID sets.
      • Supports ID ordering, hashing, and deduplication.
      • Shares in-flight computations for overlapping ID sets.
      • Provides getByIDs to get computations for subsets of IDs.
      • Provides computeIDs to compute and merge results for requested IDs, preserving order.
    • Added ComputeIDs:

      • Represents an ordered, comparable, and hashable set of IDs.
      • Supports binary search, intersection, equality, and hashing.
    • Added extensions:

      • IterableComputeOnceExtension for resolving multiple ComputeOnce instances.
      • MapComputeIDsExtension for resolving maps of TimedComputeOnce keyed by ComputeIDs.
      • ListIdValuePairExtension for binary searching (ID, value) pairs sorted by ID.
    • Typedefs:

      • ComputeCallIDs for batched ID computations.
      • ComputeIDCompare and ComputeIDHash for ID comparison and hashing.
    Open source →
    Release notes
    • ComputeOnce:

      • Renamed ComputeOnceCall to ComputeCall.
      • Added PosComputeCall callback invoked after computation completes, receiving success or error results.
      • Added posCompute field to invoke post-computation callback.
      • Updated resolve and resolveAsync to apply posCompute on success or error.
    • TimedComputeOnce:

      • Added support for posCompute callback.
    • Added ComputeOnceCache:

      • Caches TimedComputeOnce instances by key.
      • Supports retention duration for cached entries with automatic eviction.
      • Provides get method to retrieve or create cached computations.
    • Added ComputeOnceCachedIDs:

      • Extends ComputeOnceCache for batched computations by ID sets.
      • Supports ID ordering, hashing, and deduplication.
      • Shares in-flight computations for overlapping ID sets.
      • Provides getByIDs to get computations for subsets of IDs.
      • Provides computeIDs to compute and merge results for requested IDs, preserving order.
    • Added ComputeIDs:

      • Represents an ordered, comparable, and hashable set of IDs.
      • Supports binary search, intersection, equality, and hashing.
    • Added extensions:

      • IterableComputeOnceExtension for resolving multiple ComputeOnce instances.
      • MapComputeIDsExtension for resolving maps of TimedComputeOnce keyed by ComputeIDs.
      • ListIdValuePairExtension for binary searching (ID, value) pairs sorted by ID.
    • Typedefs:

      • ComputeCallIDs for batched ID computations.
      • ComputeIDCompare and ComputeIDHash for ID comparison and hashing.
    Open source →
    Release notes

    v1.2.20

    Compare

    Choose a tag to compare

    Open source →
  4. 1.2.19 21 Jan 2026
    Release notes
    • FunctionArgs0Extension, FunctionArgs1Extension, FunctionArgs2Extension:

      • tryCall: updated to catch errors from synchronous or asynchronous results and apply onError via Future.catchError if the result is a Future.
    • ComputeOnce<V>:

      • Constructor:
        • Added static helper _resolveCall to widen callbacks returning Future<Never> to FutureOr<V>.
        • Wrap _call with _resolveCall to fix Future<Never> callbacks.
      • Added isResolving getter to indicate if computation is in progress.
      • Enhanced resolve method:
        • Added parameters throwError, onError, and onErrorValue to control error handling behavior.
        • Supports returning fallback values or invoking error handlers instead of always throwing.
        • Calls onCompute callback on completion with value or error.
      • Enhanced resolveAsync method:
        • Added parameters throwError, onError, and onErrorValue for asynchronous error handling.
        • Calls onCompute callback on completion.
      • Added onCompute callback method invoked once computation completes.
      • Added className getter and improved toString to reflect current state (resolving, resolved with value, or error).
    • Added TimedComputeOnce<V> subclass:

      • Records the timestamp when computation resolves (success or failure).
      • Provides resolvedAt timestamp and elapsedTime since resolution.
      • Overrides onCompute to set resolution time.
      • Overrides className for identification.
    Open source →
    Release notes
    • FunctionArgs0Extension, FunctionArgs1Extension, FunctionArgs2Extension:

      • tryCall: updated to catch errors from synchronous or asynchronous results and apply onError via Future.catchError if the result is a Future.
    • ComputeOnce<V>:

      • Constructor:
        • Added static helper _resolveCall to widen callbacks returning Future<Never> to FutureOr<V>.
        • Wrap _call with _resolveCall to fix Future<Never> callbacks.
      • Added isResolving getter to indicate if computation is in progress.
      • Enhanced resolve method:
        • Added parameters throwError, onError, and onErrorValue to control error handling behavior.
        • Supports returning fallback values or invoking error handlers instead of always throwing.
        • Calls onCompute callback on completion with value or error.
      • Enhanced resolveAsync method:
        • Added parameters throwError, onError, and onErrorValue for asynchronous error handling.
        • Calls onCompute callback on completion.
      • Added onCompute callback method invoked once computation completes.
      • Added className getter and improved toString to reflect current state (resolving, resolved with value, or error).
    • Added TimedComputeOnce<V> subclass:

      • Records the timestamp when computation resolves (success or failure).
      • Provides resolvedAt timestamp and elapsedTime since resolution.
      • Overrides onCompute to set resolution time.
      • Overrides className for identification.
    Open source →
    Release notes

    v1.2.19

    Compare

    Choose a tag to compare

    Open source →
  5. 1.2.18 10 Jan 2026
    Release notes
    • FutureExtension:

      • Added method whenResolved to invoke a callback on future resolution (success or error) and map the outcome to a new result without automatically rethrowing errors.
    • ComputeOnce:

      • Added method whenComplete to register a callback executed when resolution completes, regardless of success or failure.
      • Added method whenResolved to invoke a callback on resolution (success or error) and map the outcome to a new result, delegating to resolveAsync and Future.whenResolved.
    Open source →
    Release notes
    • FutureExtension:

      • Added method whenResolved to invoke a callback on future resolution (success or error) and map the outcome to a new result without automatically rethrowing errors.
    • ComputeOnce:

      • Added method whenComplete to register a callback executed when resolution completes, regardless of success or failure.
      • Added method whenResolved to invoke a callback on resolution (success or error) and map the outcome to a new result, delegating to resolveAsync and Future.whenResolved.
    Open source →
    Release notes

    v1.2.18

    Compare

    Choose a tag to compare

    Open source →
  6. 1.2.17 31 Dec 2025
    Release notes
    • ComputeOnce:
      • Added typedef ComputeOnceCall<V> for the computation callback signature.
      • Changed _call field type to nullable ComputeOnceCall<V>? and clear it after computation completes to release references and prevent re-invocation.
    Open source →
    Release notes
    • ComputeOnce:
      • Added typedef ComputeOnceCall<V> for the computation callback signature.
      • Changed _call field type to nullable ComputeOnceCall<V>? and clear it after computation completes to release references and prevent re-invocation.
    Open source →
    Release notes

    v1.2.17

    Compare

    Choose a tag to compare

    Open source →
  7. 1.2.16 31 Dec 2025
    Release notes
    • async_extension:

      • Added export of src/async_extension_compute_once.dart to library.
      • New ComputeOnce.
    • Dependencies:

      • Updated test dependency from ^1.26.0 to ^1.26.3.
      • Updated coverage dependency from ^1.13.1 to ^1.15.0.
    • Update GitHub Actions to use checkout@v6 and codecov-action@v5.

    Open source →
    Release notes
    • async_extension:

      • Added export of src/async_extension_compute_once.dart to library.
      • New ComputeOnce.
    • Dependencies:

      • Updated test dependency from ^1.26.0 to ^1.26.3.
      • Updated coverage dependency from ^1.13.1 to ^1.15.0.
    • Update GitHub Actions to use checkout@v6 and codecov-action@v5.

    Open source →
    Release notes

    v1.2.16

    Compare

    Choose a tag to compare

    Open source →
  8. 1.2.15 14 May 2025
    Release notes
    • New FunctionArgs0Extension, FunctionArgs1Extension, FunctionArgs2Extension:

      • Added tryCall, tryCallThen and asFutureOr.
    • test: ^1.26.0

    • dependency_validator: ^4.1.3

    • coverage: ^1.13.1

    Open source →
    Release notes
    • New FunctionArgs0Extension, FunctionArgs1Extension, FunctionArgs2Extension:

      • Added tryCall, tryCallThen and asFutureOr.
    • test: ^1.26.0

    • dependency_validator: ^4.1.3

    • coverage: ^1.13.1

    Open source →
    Release notes

    v1.2.15

    Compare

    Choose a tag to compare

    Open source →
  9. 1.2.14 19 Dec 2024
    Release notes
    • Added Function extension: retry and retryWith.
    Open source →
    Release notes
    • Added Function extension: retry and retryWith.
    Open source →
    Release notes

    v1.2.14

    Compare

    Choose a tag to compare

    Open source →
  10. 1.2.13 18 Dec 2024
    Release notes
    • Added asyncRetry.

    • Improved asyncTry documentation.

    • lints: ^4.0.0

    • test: ^1.25.13

    • dependency_validator: ^4.1.2

    • coverage: ^1.11.1

    Open source →
    Release notes
    • Added asyncRetry.

    • Improved asyncTry documentation.

    • lints: ^4.0.0

    • test: ^1.25.13

    • dependency_validator: ^4.1.2

    • coverage: ^1.11.1

    Open source →
    Release notes

    v1.2.13

    Compare

    Choose a tag to compare

    Open source →
  11. 1.2.12 31 Mar 2024
    Release notes
    • New IterableMapEntryFutureValueExtension:

      • Added resolveAllValues.
    • New IterableMapEntryFutureKeyExtension:

      • Added resolveAllKeys.
    • New IterableMapEntryFutureExtension:

      • Added resolveAllEntries.
    Open source →
  12. 1.2.11 31 Mar 2024
    Release notes
    • New IterableAsyncExtension:
      • Added forEachAsync.
    Open source →
  13. 1.2.10 28 Mar 2024
    Release notes
    • New CompleterExtension:
      • Added completeSafe, completeErrorSafe.
    Open source →
  14. 1.2.9 14 Mar 2024
    Release notes
    • onErrorReturn: added optional parameter onError.
    • nullOnError: added optional parameters onError and onErrorOrNull.
    Open source →
  15. 1.2.8 14 Mar 2024
    Release notes
    • New AsyncExtensionErrorLogger and defaultAsyncExtensionErrorLogger:

    • New FutureOnErrorExtension:

      • logError
      • onErrorReturn
      • nullOnError
    • FutureNonNullOnErrorExtension:

      • onComplete
    • FutureNullableOnErrorExtension:

      • onComplete
      • onCompleteNotNull
    • lints: ^3.0.0

    Open source →
  16. 1.2.7 02 Mar 2024
    Release notes
    • IterableFutureOrNullableExtension:
      • whereFutureNullable, selectFuturesNullable: return Future<T?> for consistency with "Nullable" suffix.
      • waitFuturesNullable: return FutureOr<List<T?>> for consistency with "Nullable" suffix.
    Open source →
  17. 1.2.6 02 Mar 2024
    Release notes
    • New extension IterableFutureOrNullableExtension<T> on Iterable<FutureOr<T>?>:

      • whereFutureNullable, selectFuturesNullable, asFuturesNullable and waitFuturesNullable.
    • test: ^1.25.2

    • dependency_validator: ^3.2.3

    • coverage: ^1.7.2

    Open source →
  18. 1.2.5 06 Sep 2023
    Release notes
    • New ExpandoFutureExtension and ExpandoFutureOrExtension:
      • putIfAbsentAsync
    Open source →
  19. 1.2.4 23 Aug 2023
    Release notes
    • New FutureOrIterableNullableExtension and FutureIterableNullableExtension.
    Open source →
  20. 1.2.3 23 Aug 2023
    Release notes
    • New FutureNullableExtension and FutureOrNullableExtension:
      • orElseAsync and orElseGeAsync.
    Open source →
  21. 1.2.2 21 Aug 2023
    Release notes
    • FutureOrIterableExtension and FutureIterableExtension.
      • Use suffix Async to avoid extension overwrite issues.
    Open source →
  22. 1.2.1 21 Aug 2023
    Release notes
    • New FutureOrIterableExtension and FutureIterableExtension.
    • test: ^1.24.6
    Open source →
  23. 1.2.0 03 Aug 2023
    Release notes
    • sdk: '>=3.0.0 <4.0.0'
    • lints: ^2.1.1
    • test: ^1.24.4
    Open source →
  24. 1.1.1 20 Jun 2023
    Release notes
    • Optimize:

      • resolveMapped, resolveAllValuesNullable.
      • resolveAllValues, resolveAllValuesNullable, resolveAllKeys, resolveAllEntries.
    • sdk: '>=2.18.0 <4.0.0'

    • test: ^1.24.3

    Open source →
  25. 1.1.0 09 Feb 2023
    Release notes
    • Fix GitHub CI badge.
    • sdk: '>=2.18.0 <3.0.0'
    • lints: ^2.0.1
    • test: ^1.23.0
    • coverage: ^1.6.3
    Open source →
  26. 1.0.12 06 Aug 2022
    Release notes
    • asyncTry:
      • Fix issue when onError returns a Future with a type different from the main function.
    Open source →
  27. 1.0.11 06 Aug 2022
    Release notes
    • AsyncLoop:
      • Added AsyncLoop.forEach.
      • Optimize _runBody to avoid recursion.
    • asyncTry:
      • Fix behavior when an error is rethrown inside an onError block.
      • Fix behavior when an error is thrown inside an onFinally block.
      • Ensures the same behavior of standard Dart try/catch blocks.
    Open source →
  28. 1.0.10 30 Jul 2022
    Release notes
    • FutureExtension and FutureOrExtension:
      • Renamed type getter to genericType to avoid issues with nullable variables.
    • Update GitHub CI.
    • lints: ^2.0.0
    • test: ^1.17.12
    • dependency_validator: ^3.2.2
    • coverage: ^1.0.4
    Open source →
  29. 1.0.9 15 Oct 2021
    Release notes
    • whereNotNull renamed to whereNotNullSync to avoid conflict with package collection.
    Open source →
  30. 1.0.8 10 Oct 2021
    Release notes
    • Added asyncTry:
      • Executes a block in a try, then, catch and finally execution chain.
    • Using standard Dart coverage.
    • coverage: ^1.0.3
    Open source →
  31. 1.0.7 22 Sep 2021
    Release notes
    • New extension methods:
      • resolveOther
      • resolveAllNullable
    • New Map extension methods:
      • resolveAllKeys
      • resolveAllEntries
      • resolveAllValues
      • resolveAllValuesNullable
    Open source →
  32. 1.0.6 17 Sep 2021
    Release notes
    • New extension methods for nullable types:
      • whereNotNull
      • whereNotNullResolved
      • resolveAllNotNull
    • Fixed isResolved detection for when T is Object or dynamic.
    Open source →
  33. 1.0.5 13 Sep 2021
    Release notes
    • The package now exports dart:async.
    • New extensions:
      • resolveWithValue
      • resolveAllWithValue
      • resolveAllThen
      • allAsList
    • Optimized some resolutions
      • Now ensures that iterables won't be iterated more than once.
      • Ensures that List and Set won't be converted to List when not needed.
    Open source →
  34. 1.0.4 30 Jun 2021
    Release notes
    • Added AsyncLoop and AsyncSequenceLoop.
    Open source →
  35. 1.0.3 30 Jun 2021
    Release notes
    • Added FutureOr.then.
    Open source →
  36. 1.0.2 29 Jun 2021
    Release notes
    • Added resolveBoth for FutureOr and Future.
    • Add Future and FutureOr arithmetic operators.
    • Added Benchmarks:
      • async_extension_benchmark.dart
      • async_extension_benchmark2.dart
    Open source →
  37. 1.0.1 28 Jun 2021
    Release notes
    • Adjusted pubspec.yaml description.
    • Added FOSSA scan and badges.
    Open source →
  38. 1.0.0 28 Jun 2021
    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