Shard 2.0 is a big release: a handful of new shards and mixins, richer async handling, first-class listeners, and a more robust persistence format. Most of it is additive—your existing code keeps working—but there are three small breaking changes to be aware of. This page is the tour; the Migrating from 1.x guide is the mechanical checklist.
There are only three, and most apps touch at most one.
AsyncValue gained a fourth state, AsyncIdle. If you write your own exhaustive switch over an AsyncValue in app code, it will no longer compile until you handle AsyncIdle (or switch to when/maybeWhen). AsyncShardBuilder users are unaffected unless they want a distinct idle UI via onIdle:, and FutureShard/StreamShard never enter the idle state. See Migrating from 1.x.
StateStorage now requires a delete method. Any class that implements StateStorage must add Future<void> delete(String key). The contract is simple: after delete, a later load returns null, and deleting a key that was never stored is a no-op. See Migrating from 1.x.
Persisted state now uses a version envelope. Stored values are wrapped as {"__shard_v":N,"__shard_p":"…"}. No code change is required—reads are legacy-tolerant, so 1.x bare data is read as version 1 and your upgrade keeps its data. The only caveat is a 2.0→1.x downgrade, which cannot read 2.0-written data. You can optionally opt into schema migration with version/migrate. See Migrating from 1.x.
AsyncIdle, the new fourth state, and ergonomic matchers when/maybeWhen → Async ValuesmapData/whenData for transforming the success case → Async ValuesAsyncValue.guard to wrap a future into an AsyncValue → Async ValuesAsyncShardBuilder.onIdle for a distinct idle UI → WidgetsCommandShard for explicit, user-triggered actions → CommandShardcomputedShard/ComputedShard for derived state that recomputes when its sources change → ComputedShardHistoryMixin for undo/redo → Undo & RedoShard.stream to observe state changes as a stream → Core ConceptsStreamShard.pause/resume to suspend and resume a subscription → StreamShardShardListener/MultiShardListener for side effects (navigation, snackbars, dialogs) → WidgetsclearPersistence to wipe a shard's stored slice → Persistent Shardversion/migrate to evolve your persisted model → Persistent ShardflushOnPause to persist when the app is backgrounded → Persistent ShardThese landed in 1.1/1.2 and now have full docs:
LoggingObserver → Observing a ShardShardTester, FakeStateStorage, FakeCacheService, MockShardObserver) → TestingdeepEquals/DeepEqualityMixin → Core ConceptsMemoryCacheService bounding and CacheMixin logging → Response CachingNext: Migrating from 1.x.