dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.67k stars 459 forks source link

If we upload svg files in our domain or aws s3 bucket it's not working. #672

Open Sunsiha opened 2 years ago

Sunsiha commented 2 years ago

The following code am using for to load the image,

SvgPicture.network(
                      'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/AJ_Digital_Camera.svg',
                      placeholderBuilder: (context) =>
                          const CircularProgressIndicator(
                        color: AppColors.primaryPurple,
                      ),
                      height: 50.0,
                    )

The above link is not working. Then i have tried with different url(working svg link) this worked.

Why it is behaving like this. How can I sort this?

Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (5 months ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4

flutter_svg: ^1.0.0

======== Exception caught by SVG =================================================================== The following assertion was thrown while parsing PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 16.0, xHeight: 8.0)) in _getDefinitionPaint: Failed to find definition for url(#pattern0)

This library only supports and xlink:href references that are defined ahead of their references.

sahhill commented 2 years ago

@Sunsiha

Did you find any solution, we are facing the same issue.

umitmutluu commented 1 year ago

The following code am using for to load the image,

SvgPicture.network(
                      'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/AJ_Digital_Camera.svg',
                      placeholderBuilder: (context) =>
                          const CircularProgressIndicator(
                        color: AppColors.primaryPurple,
                      ),
                      height: 50.0,
                    )

The above link is not working. Then i have tried with different url(working svg link) this worked.

Why it is behaving like this. How can I sort this?

Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (5 months ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4

flutter_svg: ^1.0.0

======== Exception caught by SVG =================================================================== The following assertion was thrown while parsing PictureKey(Instance of 'NetworkPictureKeyData', colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 16.0, xHeight: 8.0)) in _getDefinitionPaint: Failed to find definition for url(#pattern0)

This library only supports and xlink:href references that are defined ahead of their references.

I Recieved same bug

nileshrathore commented 10 months ago

having the same issue!