Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vector_graphics] Error handling enhancement #8061

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

minhhung2556
Copy link

@minhhung2556 minhhung2556 commented Nov 12, 2024

Purpose

To fix these related issues below

My related PRs

Changes Made

  • Enhance error handling in VectorGraphicWidget

Testing

  • Already tested by example and unit test in flutter_svg

Impact

  • This change should not affect other parts of the library.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

# Conflicts:
#	packages/vector_graphics/CHANGELOG.md
#	third_party/packages/flutter_svg/CHANGELOG.md
@minhhung2556 minhhung2556 marked this pull request as ready for review November 13, 2024 02:21
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

Can you be more specific about what you mean by "enhance"?

This also needs a test

@minhhung2556
Copy link
Author

Can you be more specific about what you mean by "enhance"?

This also needs a test

Hi, this PR changed the method _loadPicture to check some cases that could cause an error, such as: can not load the vector file, vector byte data is empty, and decodeVectorGraphics throws an exception.
I think this change can still be tested by the current unit test.
And This PR is preprocessor of #8062 and some changes in that PR I have new tests for it already.

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

Successfully merging this pull request may close these issues.

2 participants