NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1567 most downloaded on pub.dev
WeakMap is a map whose keys are weakly held, to attach data to objects without keeping them alive. Cache functions for memoization over immutable state.
Last release 5 days ago
02 Oct 2026
Release timing varies
gaps range from 2 weeks to 1.7 years
Some releases are documented
notes for 15 of 28 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
29 releases · first in 2020
One column per quarter.
WeakContainer is now deprecated. It was created when Dart had no weak references. Use Dart's native WeakReference instead: replace WeakContainer(obj).…
WeakContainer is now deprecated. It was created when Dart had no weak
references. Use Dart's native WeakReference instead: replace
WeakContainer(obj).contains(x) with identical(WeakReference(obj).target, x).
It will be removed in a future version.
The cache functions now use a WeakReference internally to remember the
states, instead of creating one Expando per state. Same behavior, but faster.
Fixed the cache functions when the cached function throws an error. Before the fix,
the next call after an error with the same states could return null, or throw a
LateInitializationError or a null-check error, instead of recalculating.
Now the error is propagated, and the next call recalculates.
Fixed cache2states_1param, cache2states_2params and cache2states_3params
crashing when the cached function calls itself with other parameters (for example, a
memoized recursive function).
Nothing published for this version
Nothing published for this version
Fixed getOrThrow not throwing a StateError for missing object keys.
Fixed unsafe cast.
Fixed getOrThrow not throwing a StateError for missing object keys.
Fixed Dart records crashing WeakMap, WeakContainer and the cache functions.
Records are now treated like Strings and numbers (compared by equality).
Requires Dart 3.0.0.
Fixed a memory leak in the cache functions with 2 or 3 states, which could keep the first state and the cached result in memory after they were no longer used.
Many more tests, including garbage-collection tests.
* Sponsored by MyText.ai ![]
Nothing published for this version
* Flutter 3.10.0 and Dart 3.0.0
Nothing published for this version
cache2states_3params((state1, state2) => (param1, param2, param3) => ...);
cache2states_3params((state1, state2) => (param1, param2, param3) => ...);* Docs improvement.
Nothing published for this version
* NNBD improvement.
Nothing published for this version
Cache functions with extra parameters.
Now, cache functions are:
cache1state((state) => () => ...);
cache1state_1param((state) => (parameter) => ...);
cache1state_2params((state) => (param1, param2) => ...);
cache2states((state1, state2) => () => ...);
cache2states_1param((state1, state2) => (parameter) => ...);
cache2states_2params((state1, state2) => (param1, param2) => ...);
cache3states((state1, state2, state3) => () => ...);
cache1state_0params_x((state1, extra) => () => ...);
cache2states_0params_x((state1, state2, extra) => () => ...);
cache3states_0params_x((state1, state2, state3, extra) => () => ...);
Nothing published for this version
* cache3_0.
* Dependency bump.
* Cache functions.
Nothing published for this version
* Add is by identity. * Docs improvement.
Nothing published for this version
Nothing published for this version
Removed dependency on Flutter (it's now pure Dart).
Nothing published for this version
Nothing published for this version
Nothing published for this version
* Example.
Nothing published for this version
* WeakMap and WeakContainer.
Your coding agent can read these notes before it upgrades. Set up the MCP server →