NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #4666 most downloaded on pub.dev
Dart Useful Tools - collections, math, date, uri, json, events, resources, regexp, etc...
Last release 7 months ago
26 Feb 2026
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
84 releases · first in 2018
Replaced _purged field type from DualLazyWeakMap to Map<K, _PurgedValue<V>> .
TreeReferenceMap:
_purged field type from DualLazyWeakMap to Map<K, _PurgedValue<V>>.(value, time) records instead of MapEntry<DateTime, V>.LazyWeakReference:
strongIfWeak({bool keepWeakRef = true}) method to promote a weak reference to strong if possible.weak_map.dart:
_Entry equality to support comparison with raw keys using identity._EntryKey equality to use identity comparison and consistent hash code checks._EntryLazyRef and _EntryLazyRefValue to use strongIfWeak() for key and value retrieval._keyLazyRefManager and _valueLazyRefManager non-nullable in LazyWeakKeyMap and DualLazyWeakMap._createEntry methods in LazyWeakKeyMap and DualLazyWeakMap to always create lazy weak entries with non-null managers.WeakKeyMap, DualWeakMap.
LazyWeakKeyMap, DualLazyWeakMapOne column per quarter.
Replaced _purged field type from DualWeakMap to DualLazyWeakMap .
TreeReferenceMap:
_purged field type from DualWeakMap to DualLazyWeakMap.LazyWeakReferenceManagerByType to create DualLazyWeakMap instances for purged entries.ExpandoWithFinalizer:
WithFinalizer base class.FinalizerValueWrapper abstraction and concrete implementations:
SimpleFinalizerWrapper, SimpleFinalizerWrapperDebugExpandoValueWrapper, ExpandoValueWrapperDebugAttachOnlyFinalizer class for write-only finalizer usage.debug mode to retain weak references to keys for inspection.lazy_weak_reference.dart:
GenericReference interface for strong/weak reference abstraction.LazyWeakReferenceManagerByType singleton managing per-type LazyWeakReferenceManager instances.toString and compareTo improvements to LazyWeakReference.LazyWeakReferenceManagerByType class for centralized management.toString override to LazyWeakReferenceManager.weak_map.dart:
_EntryLazyRef, _EntryLazyRef1, _EntryLazyRef2, _EntryLazyRefValue.WeakKeyMap: include _autoPurge in isAutoPurgeRequired and centralize auto-purge check.LazyWeakKeyMap subclass using lazy weak references for keys.DualLazyWeakMap subclass using lazy weak references for keys and values.WeakKeyMap.configured and DualWeakMap.configured to create lazy weak reference variants.removeWhereKey extension method on Map and WeakKeyMap.removeWhereKey.DualWeakMap to optionally use lazy weak references for keys and values.resource.dart:
ResourceContentCache to use private _onLoadEventStream instead of public onLoad field.ResourceContent to lazily initialize _onLoadEventStream and use it internally._onLoadEventStream?.add instead of onLoad.add.Added intrusive doubly-linked list fields _prev and _next for internal queue management.
LazyWeakReference:
_prev and _next for internal queue management.target and targetIfStrong getters using null-coalescing.LazyWeakReferenceManager:
SplayTreeSet with an intrusive doubly-linked aging queue (_head, _tail) for strong references._pushBack and _remove methods for O(1) insertion and removal in the aging queue._handleNewStrongRef and _handleAccessStrongRef to use the intrusive queue._handleNewWeakRef and _handleDisposedRef to remove references from the queue using _remove._weakenStrongRefs to process references from the queue head and schedule next weakening based on precise delay.SplayTreeSet used for aging strong references with an intrusive doubly-linked aging queue.| Structure | Avg Time |
|---|---|
| Intrusive aging queue | ~22 ms |
| Queue | ~35 ms |
| WeakRef queue | ~60 ms |
| SplayTreeSet (previous) | ~205 ms |
Impact:
SplayTreeSet implementationQueueGitHub Actions workflow ( .github/workflows/dart.yml ):
GitHub Actions workflow (.github/workflows/dart.yml):
actions/checkout from v2 to v6.test_vm and test_chrome jobs for VM and Chrome platforms respectively.codecov/codecov-action from v1 to v5.dart pub publish --dry-run step to the main build job.LazyWeakReference:
Comparable<LazyWeakReference> with a strict total order based on _unixTimeMs and unique id.id field as a unique sequence identifier assigned by the manager.unixTimeMs getter._unixTimeMs updates from strong() method; now managed by LazyWeakReferenceManager.id and defer _unixTimeMs assignment to manager.LazyWeakReferenceManager:
_refIdCount to assign unique ids to references.Queue to SplayTreeSet ordered by LazyWeakReference.compareTo._handleNewStrongRef and _handleAccessStrongRef to update _unixTimeMs and maintain ordering in _strongRefs._handleNewWeakRef and _handleDisposedRef to remove references from _strongRefs._weakenStrongRefs to process references from _strongRefs in order, removing the oldest eligible references first.Holds a reference that starts strong and automatically degrades to weak after a delay.
Added LazyWeakReference<T>:
target, targetIfStrong, isStrong, isWeak, isAlive, isLost, isDisposed properties.strong() and weakening via weak().LazyWeakReferenceManager.Added LazyWeakReferenceManager<T>:
strong() and weak() factory methods to create managed references.Updated lib/swiss_knife.dart:
src/lazy_weak_reference.dart.Rollback: avoid WeakReference issues with WASM on Android/Chrome:
TreeReferenceMap:
WeakReference issues with WASM on Android/Chrome:
_map from WeakKeyMap<K, V> to standard Map<K, V>._map method calls from containsKeyNoPurge to standard containsKey.put, get, addAll, containsKey, and containsValue methods to work with the new _map type.Added new DualMap<K, V> class in lib/src/dual_map.dart :
Added new DualMap<K, V> class in lib/src/dual_map.dart:
MapBase<K, V> interface.put(K key, V value): associates value with key, replacing existing mappings.get(Object? key): returns value for key.getKeyFromValue(V value): returns key for value.putIfAbsent(K key, V Function() ifAbsent): inserts if key absent.putValueIfAbsent(K key, V value): inserts value if key absent, returns bool.remove(Object? key): removes key and reverse mapping.clear(): clears all mappings.keys, values, entries provide iterable views.Updated lib/swiss_knife.dart:
src/dual_map.dart.putValueIfAbsent : updated to call _onPutEntry and increment _unpurgedCount when a new entry is inserted.
WeakKeyMap:
putValueIfAbsent: updated to call _onPutEntry and increment _unpurgedCount when a new entry is inserted.getParentKey : fixed handling of purged entries by using _map.containsKeyNoPurge and nullable _purged .
TreeReferenceMap:
getParentKey: fixed handling of purged entries by using _map.containsKeyNoPurge and nullable _purged.containsKey: changed to use _map.containsKeyNoPurge to avoid purging during lookup.New ExpandoWithFinalizer.
WeakKeyMap and DualWeakMap:
containsKeyNoPurge and containsValueNoPurge methods to check presence without purging collected entries.getNoPurge method to get value without purging.putValueIfAbsent method to insert a value only if absent._EntryKey for consistent behavior.containsValue in DualWeakMap to properly check presence with purging logic.swiss_knife.dart:
ExpandoWithFinalizer from the public API.Changed _controller field to nullable _controllerObj and lazily initialized it.
EventStream:
_controller field to nullable _controllerObj and lazily initialized it._stream field to nullable _streamObj and lazily initialized it as a broadcast stream.add and addError methods to check isUsed (based on _streamObj presence) before adding events.close, isClosed, and isPaused to handle nullable _controllerObj.isUsed getter to indicate if the stream has been used (initialized).New FlatHashMap:
pubspec.yaml:
dependency_validator version from ^5.0.3 to ^5.0.4.Added WeakKeyMap and DualWeakMap classes in weak_map.dart:
Added WeakKeyMap and DualWeakMap classes in weak_map.dart:
SwappedDualWeakMap view for key-value swapped access._EntryRef classes.Updated TreeReferenceMap in collections.dart:
WeakKeyMap for weak key references.autoPurgeThreshold field and logic to control auto-purge frequency.onPurgedEntries callback for purged entries notification.DualWeakMap.keysReversed getter returning reversed keys list.Updated EventStream in events.dart:
_listenSignatures from non-nullable to nullable Set._listenSignatures.Updated swiss_knife.dart:
weak_map.dart.Updated pubspec.yaml:
test dependency to ^1.29.0.dependency_validator to ^5.0.3.getSubValues: added parameter traverseSubValues.
TreeReferenceMap:
getSubValues: added parameter traverseSubValues.Optimize getSubValuesImpl and _walkTreeImpl to avoid self-recursion and use a stack-based algorithm.
TreeReferenceMap:
getSubValuesImpl and _walkTreeImpl to avoid self-recursion and use a stack-based algorithm.Fix parsing for XML: change result from text/xml to application/xml (oficial).
MimeType:
XML: change result from text/xml to application/xml (oficial).test: ^1.26.2
dependency_validator: ^5.0.2
collection: ^1.19.1
coverage: ^1.15.0
- sdk: '>=3.6.0 <4.0.0' - intl: ^0.20.2 - resource_portable: ^3.1.2 - lints: ^5.1.1 - test: ^1.25.15 - collection: ^1.19.0
sdk: '>=3.6.0 <4.0.0'
intl: ^0.20.2
resource_portable: ^3.1.2
lints: ^5.1.1
test: ^1.25.15
collection: ^1.19.0
- Optimize toFlatListOfStrings. - Added trimListOfStrings. - sdk: '>=3.4.0 <4.0.0' - lints: ^4.0.0 - test: ^1.25.14 - dependency_validator: ^4.1.2 - c
Optimize toFlatListOfStrings.
Added trimListOfStrings.
sdk: '>=3.4.0 <4.0.0'
lints: ^4.0.0
test: ^1.25.14
dependency_validator: ^4.1.2
coverage: ^1.11.1
Added isYAML, isFont, isPDF, isDart, isOctetStream,
MimeType:isYAML, isFont, isPDF, isDart, isOctetStream,isZip, isGZip, isBZip2, isXZ, isCompressed.isTar, isTarGZip, isTarBZip2, isTarXZ, isTarCompressed.Added applicationOctetStream and bytes.
MimeType:
applicationOctetStream and bytes.test: ^1.25.8
coverage: ^1.9.0
- sdk: '>=3.3.0 <4.0.0' - intl: ^0.19.0 - lints: ^3.0.0 - test: ^1.25.2 - dependency_validator: ^3.2.3 - collection: ^1.18.0 - coverage: ^1.7.2
sdk: '>=3.3.0 <4.0.0'
intl: ^0.19.0
lints: ^3.0.0
test: ^1.25.2
dependency_validator: ^3.2.3
collection: ^1.18.0
coverage: ^1.7.2
MimeType: fix charset for text/html type.
MimeType: fix charset for text/html type.
sdk: '>=2.18.0 <4.0.0'
intl: ^0.18.1
resource_portable: ^3.1.0
parse: optimize and update recognized types.
MimeType:
parse: optimize and update recognized types.byExtension: add more extensions.getCharsetEncoding.listen: new parameter overwriteSingletonSubscription.
EventStream:
listen: new parameter overwriteSingletonSubscription.cancelSingletonSubscription: now ensures that the previous
subscription is removed from internal handler.Code adjustments for lints: ^2.0.1.
lints: ^2.0.1.Added constructor DataURLBase64.from.
DataURLBase64:
DataURLBase64.from.- parseBool: - Improve possible valid values.
parseBool:NOTE: some constants were renamed to lowercase camel case.
lints:
Fixed ResourceContent load with errors.
ResourceContent load with errors.Fixed formatDecimal for scientific notation.
Math.clamp.formatDecimal for scientific notation.Added UniqueCaller and parseIntList.
UniqueCaller and parseIntList.Null safety migration adjustments.
collections: improve Null Safety usage.
collections: improve Null Safety usage.Null safety migration adjustments.
Null safety migration adjustments.
Null safety migration adjustments.
Sound null safety compatibility.
Optimize: parseInt, parseDouble and parseNum.
parseInt, parseDouble and parseNum.listNotMatchesAll and listMatchesAny when leading with lists with null elements.dartfmt and dartanalyzer.TreeReferenceMap: ensure that root is not null.
TreeReferenceMap: ensure that root is not null.EventStream: Added listenOneShot.- TreeReferenceMap: - fix getParentKey.
TreeReferenceMap:
getParentKey.Added TreeReferenceMap: an alternative to Weak References (nonexistent in Dart).
TreeReferenceMap: an alternative to Weak References (nonexistent in Dart).MimeType.byExtension: Added parameter defaultAsApplication.
MimeType.byExtension: Added parameter defaultAsApplication.MimeType: Added htmlTag and isAudio.
MimeType: Added htmlTag and isAudio.unquoteString.Added ContextualResource and ContextualResourceResolver:
ObjectCache.Dimension.ContextualResource and ContextualResourceResolver:
parseFromInlineProperties and dateFormat_YYYY_MM.EventStream:
eventValidator.Math:
minMax, maxInList and minInList: added optional comparator parameter.MimeType: Added isCharsetUTF16, isText, isXML, isXHTML, isFormURLEncoded, isStringType.
MimeType: Added isCharsetUTF16, isText, isXML, isXHTML, isFormURLEncoded, isStringType.dateFormat_YY*: added optional parameter delimiter.InteractionCompleter: Added field triggerDelayLimit.Math:
subtract, multiply and divide.- Improve API Documentation.
Added resolveURL, similar to resolveUri.
resolveURL, similar to resolveUri.replaceStringMarks.buildStringPattern using replaceStringMarks and now returns empty string for null parameters.EventStreamDelegator, to point to instances of EventStream not instantiated yet.ListenerWrapper, to handle StreamSubscription related to a listener and useful to create one shot listeners.New AsyncValue: to handle values that comes from Future.
AsyncValue: to handle values that comes from Future.isEncodedJSON, isEncodedJSONList and isEncodedJSONMap: to check if a String is an encoded JSON.isDigit, isAlphaNumeric, isDigitString, isAlphaNumericString.listMatchesAny, isListValuesIdentical, listContainsAll, ensureNotEmptyString, deepCatchesValues.MimeType.fileExtension: support for svg, xhtml, mpeg, mp3, ico.getUriRootURL, getUriBaseHostAndPort, resolveUri.Added: isEmptyString, isNotEmptyString, isListEntriesAllOfType.
isEmptyString, isNotEmptyString, isListEntriesAllOfType.deepCopyMap.deepCopy: added parameter copier.NNField: Added resolver.MimeType: added SVG support.InteractionCompleter:
interact: Added parameters interactionParameters and ignoreConsecutiveEqualsParameters.dispose.encodeJSON: Added parameter toEncodable.toEncodableJSON.parseInt, parseDouble and parseNum now returns default value (def) in case of parsing error..00 pattern.dataSizeFormat.Added constructor MimeType.byExtension.
MimeType: Added new types.MimeType.byExtension.MimeType: Fixed parsing of gif.EventStream: Added cancelAllSingletonSubscriptions, cancelSingletonSubscription, getSingletonSubscription.listenStreamWithInteractionCompleter.removeUriQueryString: avoid blank fragment in the URL.
removeUriQueryString: avoid blank fragment in the URL.Added isPositiveNumber, isNegativeNumber.
isPositiveNumber, isNegativeNumber.MimeType.APPLICATION_ZIP.maxInIterable, minInIterable.deepReplaceValues, deepReplaceListValues, deepReplaceMapValues.parseComparable, removeEmptyEntries, sortMapEntries, sortMapEntriesByValue, sortMapEntriesByKey.parseBool: if value is a num: true = v > 0
NNField.clipNumber.parseBool: if value is a num: true = v > 0- Fix typo.
Added: parseJSON, isBlankString, isBlankStringInRange, isEqualsSet, isEqualsIterable.
MimeType: Added charset.parseJSON, isBlankString, isBlankStringInRange, isEqualsSet, isEqualsIterable.asTreeOfKeyString, parseMapEntry, groupIterableBy, sumIterable, averageIterable.parseJSON, encodeJSON.splitRegExp. split now accepts Pattern (String and RegExp).isBlankCodeUnit.Added string helpers: isBlankChar, isBlankCodeUnit, hasBlankChar, hasBlankCharInRange.
isBlankChar, isBlankCodeUnit, hasBlankChar, hasBlankCharInRange.catFile, catFileBytes, saveFile, saveFileBytes.InteractionCompleter: cancelisEqualsList, isEqualsMap.New event handler: InteractionCompleter.
isInUnixEpochRangeInteractionCompleter.- dartfmt - test_coverage: ^0.4.2
Change isEmptyValue to is isEmptyObject.
isEmptyValue to is isEmptyObject.isNotEmptyObject.Fix MimeType.parse when parameter mimeType is empty and defaultMimeType is null.
MimeType.parse when parameter mimeType is empty and defaultMimeType is null.DataURLBase64.asDataURLStringfix buildStringPattern() extraParameters issue.
Math.mean() returns 0 on empty lists.
Your coding agent can read these notes before it upgrades. Set up the MCP server →