-
Notifications
You must be signed in to change notification settings - Fork 449
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
SVG Compare Asset Testing #852
Comments
I found a solution for this. Just do it this way: final findAsset = find.byWidgetPredicate(
(widget) =>
widget is SvgPicture &&
(widget.bytesLoader as SvgAssetLoader) // Here!
.assetName
.compareTo('assets/flutter.svg') ==
0,
); Is this an interesting approach? I believe so. I'll leave the issue open as I'm open to feedback and if there's something better to be done here. And I also made the commit. |
Yes, this is the correct way to fix this issue. |
Ok, @dnfield. Thanks for answer. :) |
This would be great as part of a migration guide - btw there are still references to the picture provider in the code documentation. |
Hi!
Before the version
2.0.0
, I had this test that worked fine and made the assertion I wanted.However, after
2.0.0
this testis invalid because there were internal change in the package, e.g:The getter 'pictureProvider' isn't defined for the type 'SvgPicture'. Try importing the library that defines 'pictureProvider', correcting the name to the name of an existing getter, or defining a getter or field named 'pictureProvider'.
The name 'ExactAssetPicture' isn't a type, so it can't be used in an 'as' expression. Try changing the name to the name of an existing type, or creating a type with the name 'ExactAssetPicture'.
I would be like to know which is the best option to follow, with the new version of the package.
I also made a Minimal Reproducible Example:
The text was updated successfully, but these errors were encountered: