Repository navigation
fix(flutter_svg): honor default placeholders during asynchronous SVG loading - #4
Merged
palmoni5 merged 23 commits intoNov 9, 2026
Merged
Conversation
This was referenced Nov 9, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 25, 2026
`SvgPicture.debugFillProperties` compares `Clip` values to `BoxFit.contain`, so the default `Clip.hardEdge` is incorrectly reported as a non-default diagnostic property. Compare against the actual constructor default, `Clip.hardEdge`. The regression test checks that the default is omitted and a non-default `Clip.none` is reported. It fails against the original implementation and passes after the fix. Validation on Windows: `dart format lib/svg.dart test/clip_diagnostics_test.dart`, `flutter analyze` (no issues), and complete `flutter test` (72 passed, one existing skipped test). Existing platform golden differences are tolerated by the repository comparator. Final checks ran after rebasing on latest upstream/main. Prepared with AI assistance and reviewed by the contributor. Fixes flutter/flutter#197014. Original fork bug report: Otzaria#4. Each issue is submitted independently. Overlap: `git merge-tree --write-tree upstream/pr-12808 HEAD` reports a CHANGELOG-only conflict with #12808; no code overlap. Merged with main (including 2.5.0 from #13598) and bumped to 2.5.1; analyze and the complete test suite pass after the merge (94 passed, one existing skip). ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug and user impact
SvgPicture.defaultPlaceholderBuilderis documented and publicly configurable but was never passed through when a widget omitted its own placeholder builder. This PR honors the fallback while preserving each widget's explicit builder precedence. On slow asset/network loads the default placeholder can now be used consistently. Also fixesdebugFillPropertiesincorrectly comparingclipBehavioragainstBoxFit.containinstead ofClip.hardEdge.QA
Widget regression tests exercise an unresolved network SVG, global fallback, explicit placeholder precedence and removal after successful loading. The scoped
flutter_svg QAworkflow performsflutter analyze,flutter testincluding widget/golden tests anddart formatchecks.No dependency pin to a Git commit is added to Otzaria. A coordinated package version bump can follow consolidation of the fork fixes.
Independent QA and integration
Reviewed independently with added regression tests. Static analysis and the full flutter_svg suite passed locally after integration. The isolate change additionally preserves provideSvg overrides on all five built-in loader subclasses. Network keys memoize immutable hashes and use identityHashCode for injected clients.
Final exact tested commit: 4ad4cda. Cross-platform Linux/Windows CI: https://github.com/palmoni5/packages/actions/runs/42628430755 (see live run for final result).
Upstream topics: flutter#13595, flutter#13596, flutter#13597, flutter#13598, flutter#13599 and flutter#13600. Reviewer changes must be applied to both the corresponding upstream branch and codex/flutter-svg-combined.