Open rgjurgens opened 2 years ago
Any thoughts, remarks? Do I need to provide more information?
I had the same issue SvgPicture.network, and I solved with HttpOverrides.
In your case, you could mock the AssetBundle.
Another solution that I used in my code, is to convert the svg icons to a font pack. That way I can use them as Icon
like I would do with a material icon, instead of Svg.
Realise this was a long time ago, but what folders do you have added to your pubspec.yaml? I saw this issue when I forgot to add the path to the containing folder, as well as the overall folder. ie
assets:
- assets/
- assets/buttons/
How the assets loaded was actually not consistent between running the app and running the tests. Adding the subfolders made it work for both.
I'm using
flutter_svg
throughout our project and it works just fine. However, if I'm running the app in an integration test, the app crashes on assets that cannot be found. The error message is as follows, I'm using the latestflutter_svg
version:This is the code in my test: