Skip to content

[flutter_svg] Add golden widget tests for SVG filters - #13658

Open
edwin-hollen wants to merge 1 commit into
flutter:mainfrom
edwin-hollen:upstream-svg-filters-goldens
Open

edwin-hollen wants to merge 1 commit into
flutter:mainfrom
edwin-hollen:upstream-svg-filters-goldens

Conversation

@edwin-hollen

Copy link
Copy Markdown
Contributor

Adds golden widget and edge-case tests in flutter_svg for SVG <filter> support (feGaussianBlur, feOffset, feMerge, feMergeNode), and updates dependency constraints to vector_graphics: ^1.3.0, vector_graphics_codec: ^1.2.0, and vector_graphics_compiler: ^1.3.6.

Follow-up to #11909
Fixes flutter/flutter#158592

Added Golden Tests

  • filter.gaussian_blur.png: Isotropic feGaussianBlur (stdDeviation="4").
  • filter.offset.png: feOffset (dx="20", dy="15").
  • filter.drop_shadow.png: Multi-primitive drop shadow (feGaussianBlur on SourceAlpha, feOffset, feMerge).
  • filter.gradient_drop_shadow.png: Drop shadow on a shape filled with a linearGradient.
  • filter.group_opacity.png: <g filter="url(#...)" opacity="0.5"> compositing a multi-layer filter once under group opacity.
  • filter.anisotropic_blur.png: Directional feGaussianBlur (stdDeviation="12 1").
  • filter.scaled_transform.png: Drop shadow under <g transform="scale(2)"> scaling blur and offset proportionally.

Also adds widget tests for stdDeviation="0", negative feOffset (dx/dy), and mixed unsupported filter fallback (feFlood + feGaussianBlur).

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-only.
  • I wrote epic tests if I helped fix a bug or made a change.
  • All existing and new tests are passing.

@github-actions github-actions Bot added p: flutter_svg triage-engine Should be looked at in engine triage labels Nov 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates flutter_svg to version 2.4.1, adding support for SVG filters including feGaussianBlur, feOffset, and feMerge. It bumps the versions of vector_graphics, vector_graphics_codec, and vector_graphics_compiler in pubspec.yaml, and adds a new group of widget tests in widget_svg_test.dart to verify the correct rendering and fallback behavior of these filters. There are no review comments, and I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: flutter_svg triage-engine Should be looked at in engine triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_svg] Add (some) support for blur effect

1 participant