Flutter_svg doens´t work over network
I have test this plugin using the network constructor and doesn´t work: I get this error:
The following ProgressEvent$ object was thrown resolving a single-frame picture stream: [object ProgressEvent]
When the exception was thrown, this was the stack Picture provider: NetworkPicture("https://DOMAIN/right-arrow.svg", headers: null, colorFilter: null) Picture key: NetworkPicture("https://DOMAIN/right-arrow.svg", headers: null, colorFilter: null)
My code is:
Column(
children: [
SvgPicture.network(
"https://DOMAIN/public/right-arrow.svg",
width: 100,
height: 100,
semanticsLabel: 'A shark?!',
placeholderBuilder: (BuildContext context) => Container(
padding: const EdgeInsets.all(10),
child: const CircularProgressIndicator(),
),
)
],
)
I tested this exactly SVG over the network (doesn´t work) and just copy it in the assets folder, so , using SvgPicture.asset. And this works... So, the problem is not in the svg, because is exactly the same. The problem i guest is with the Plugin. I event tried to set the headers to this: headers: {'Content-Type': 'image/svg+xml'}, But does not work as well.
Any suggestion?
Thanks
got same problem here, any one ?
any solution?
same issue.
Same, for Flutter Web, it doesn't happen with the same SVG as an asset but gives an error when stored in Google Cloud Storage.
======== Exception caught by SVG ===================================================================
The following ProgressEvent$ object was thrown resolving a single-frame picture stream:
[object ProgressEvent]
When the exception was thrown, this was the stack:
Picture provider: NetworkPicture("https://firebasestorage.googleapis.com/v0/b/not_rea_bucket_name/o/ace.svg?alt=media", headers: null, colorFilter: null)
Picture key: PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: Color(0xff000000), fontSize: 16, xHeight: 8))
====================================================================================================
Flutter 3.7.0 • channel stable
Framework • revision b06b8b2710 (8 days ago) • 2023-01-23 16:55:55 -0800
Engine • revision b24591ed32
Tools • Dart 2.19.0 • DevTools 2.20.1
My bad. My issue was with web CORS restriction.
flutter_svg caught Exception doesn't show the real one, that was for me: XMLHttpRequest error
My bad. My issue was with web CORS restriction.
flutter_svgcaught Exception doesn't show the real one, that was for me:XMLHttpRequest error
How did you fix your issue? I am having the same problem
My bad. My issue was with web CORS restriction.
flutter_svgcaught Exception doesn't show the real one, that was for me:XMLHttpRequest errorHow did you fix your issue? I am having the same problem
I fixed it, it was related to CORS and Firebase Storage. Just follow this youtube video: https://www.youtube.com/watch?v=tvCIEsk4Uas