Skip to content
Boring Doc
DeprecatedMedium impactOfficial migration guidesince 3.29.0landed 3.29.0-0.0.preweb

Deprecate WebGoldenComparator

Framework · Official source

The `flutter_test` package and `flutter` tool will no longer use the `webGoldenComparator` top-level variable, and instead use the original `goldenFileComparator` top-level variable (like the non-web platforms).

Who is affected
Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses WebGoldenComparator, GoldenFileComparator.
Practical impact
Warnings now; removal in a future release. Plan the migration but no immediate break.
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)

For most users, no changes are required (other than migrating off the HTML backend, which is not covered here), the flutter tool will automatically configure [goldenFileComparator][] and use it (when using a non-HTML web backend).

For users that implement a custom [WebGoldenComparator][], you will migrate the implementation to [GoldenFileComparator][]. Fortunately the Canvas Kit and SkWasm backends already required similar methods (compareButes and updateBytes).

For example:

// Before
class MyWebGoldenComparator extends WebGoldenComparator {
  @override
  Future<bool> compare(double width, double height, Uri golden) {
    // will be removed in the migration
  }

  @override
  Future<bool> update(double width, double height, Uri golden) {
    // will be removed in the migration
  }

  @override
  Future<bool> compareBytes(Uint8List bytes, Uri golden) {
    // will be renamed "compare"
  }

  @override
  Future<bool> updateBytes(Uint8List bytes, Uri golden) {
    // will be renamed "update" and the parameter orders swapped
  }
}

// After
class MyGenericGoldenComparator extends GoldenFileComparator {
  @override
  Future<bool> compare(Uint8List bytes, Uri golden) {
    // used to be "compareBytes"
  }

  @override
  Future<bool> update(Uri golden, Uint8List bytes) {
    // used to be "updateBytes"
  }
}
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set 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.
Official migration guide·Verified classification (90%)

Listed in the official breaking-changes index; title states deprecation.

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.

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 explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set 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.
Was this useful?