`ImageCache` now has a method called `containsKey`. `ImageProvider` subclasses should not override `resolve`, but instead should implement new methods on `ImageProvider`. These changes were submitted as a single commit to the framework.
Original behavior
Not stated in the source.
New behavior
The sections below describe the changes to `containsKey` and `ImageProvider`.
- Who is affected
- Applications and packages relying on the previous behaviour or signature. Code that uses ImageCache, ImageProvider, ImageProvider.load and related APIs.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
ImageCache change
Before migration, the code would not have an override of containsKey.
Code after migration:
class MyImageCache implements ImageCache {
@override
bool containsKey(Object key) {
// Check if your custom cache is tracking this key.
}
...
}ImageProvider change
Code before the migration:
class MyImageProvider extends ImageProvider<Object> {
@override
ImageStream resolve(ImageConfiguration configuration) {
// create stream
// set up error handling
// interact with ImageCache
// call obtainKey/load, etc.
}
...
}Code after the migration:
class MyImageProvider extends ImageProvider<Object> {
@override
ImageStream createStream(ImageConfiguration configuration) {
// Return stream, or use super.createStream(),
// which returns a new ImageStream.
}
@override
void resolveStreamForKey(
ImageConfiguration configuration,
ImageStream stream,
Object key,
ImageErrorListener handleError,
) {
// Interact with the cache, use the key, potentially call `load`,
// and report any errors back through `handleError`.
}
...
}
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Official migration guide
- ImageCache
- ImageProvider
- ScrollAwareImageProvider
- Issue #32143
- Issue #44510
- Issue #48305
- Issue #48775
- Defer image decoding when scrolling fast #49389
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.