Repository: flutter
Issue: [flutter_svg] SvgPicture.network() don't shows the image but no errors getted
Labels: package,p: flutter_svg

_Imported from https://github.com/dnfield/flutter_svg/issues/103_

Original report by @quetool on Jan 17, 2019

Like the title says, SvgPicture.network('https://staging.apperto.co/rocketchat/avatar/mhuergo') doesn't shows up no matter where I put the widget

---
Comment by @dnfield on Jan 17, 2019
I'm not sure why you're not getting errors, but it looks like percentages don't work for width and height parameters on a rect right now.

I get a stack dump like this:

```
flutter: ══╡ EXCEPTION CAUGHT BY SVG ╞═══════════════════════════════════════════════════════════════════════
flutter: The following FormatException was thrown resolving a single-frame picture stream:
flutter: Invalid double
flutter: 100%
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      double.parse (dart:core/runtime/libdouble_patch.dart:110:28)
flutter: #1      _Paths.rect (package:flutter_svg/src/svg/parser_state.dart:506:29)
flutter: #2      SvgParserState.addShape (package:flutter_svg/src/svg/parser_state.dart:664:31)
flutter: #3      SvgParserState.startElement (package:flutter_svg/src/svg/parser_state.dart:689:12)
flutter: #4      SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:590:15)
flutter: <asynchronous suspension>
...
```

This should be supportable but I'm not sure it's a trivial fix.  I'd be happy to take a PR for it.


---
Comment by @dnfield on Jan 17, 2019
(Are you sure your testing device/emulator is connected to the network?)

---
Comment by @quetool on Jan 17, 2019
I will look into it!

> (Are you sure your testing device/emulator is connected to the network?)

Yes, off course :)




---
Comment by @mintermania on Jun 10, 2019
I got the same problem, all svg images work fine, except of those:
https://btcsecure.io/img/logo.svg
https://minter.stakeholder.space/local/templates/minter_pool/images/logo.svg
https://minter.center/images/MC_logo_svg.svg

---
Comment by @bailyzheng on Jun 29, 2019
I found that it will report "Invalid double" when it contains ```<rect width="100%" height="100%" fill="#ffffff"/>```

---
Comment by @hirenvadher954 on Aug 27, 2019
Can anyone able to solve it some SVG images won't able to render and throw an error like "The following FormatException was thrown resolving a single-frame picture stream".

---
Comment by @hirenvadher954 on Aug 27, 2019
> I'm not sure why you're not getting errors, but it looks like percentages don't work for width and height parameters on a rect right now.
> 
> I get a stack dump like this:
> 
> ```
> flutter: ══╡ EXCEPTION CAUGHT BY SVG ╞═══════════════════════════════════════════════════════════════════════
> flutter: The following FormatException was thrown resolving a single-frame picture stream:
> flutter: Invalid double
> flutter: 100%
> flutter:
> flutter: When the exception was thrown, this was the stack:
> flutter: #0      double.parse (dart:core/runtime/libdouble_patch.dart:110:28)
> flutter: #1      _Paths.rect (package:flutter_svg/src/svg/parser_state.dart:506:29)
> flutter: #2      SvgParserState.addShape (package:flutter_svg/src/svg/parser_state.dart:664:31)
> flutter: #3      SvgParserState.startElement (package:flutter_svg/src/svg/parser_state.dart:689:12)
> flutter: #4      SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:590:15)
> flutter: <asynchronous suspension>
> ...
> ```
> 
> This should be supportable but I'm not sure it's a trivial fix. I'd be happy to take a PR for it.
The same error occurred to me now tell us how to solve it if possible?

---
Comment by @dnfield on Aug 27, 2019
Your SVG is using a `%` where it's not currently supported.  If you have the SVG in question we could look at it and see about making it work.

---
Comment by @hirenvadher954 on Aug 28, 2019
> Your SVG is using a `%` where it's not currently supported. If you have the SVG in question we could look at it and see about making it work.

https://restcountries.eu/data/asm.svg

---
Comment by @sonikslayer on May 6, 2020
> > Your SVG is using a `%` where it's not currently supported. If you have the SVG in question we could look at it and see about making it work.
> 
> https://restcountries.eu/data/asm.svg

Was there ever a fix to this?

---
Comment by @zhangao0086 on Jun 11, 2020
+1

---
Comment by @denizdogan on Sep 5, 2020
Having the exact same problem, also with a flag: https://restcountries.eu/data/bra.svg

---
Comment by @bydev777 on Jan 2, 2021
Find in your SVG file and remove this :   width="100%" height="100%" will help

---
Comment by @martin-jorgensen on Jun 3, 2021
Still doesn't work: [https://restcountries.eu/data/asm.svg](https://restcountries.eu/data/asm.svg) 
Invalid double
1pt
When using SvgPicture.network(), the SVG is online, and changing it on the fly hardly seems like the right solution (though it might be necessary, until a real solution is in place )


---
Comment by @Prasan02 on Sep 1, 2021
I am facing the same issue, do we have any solution yet?

---
Comment by @osmanGuler19 on Oct 28, 2021
Faced the same issiue

---
Comment by @hitripod on Nov 10, 2021
same here: https://storage.opensea.io/files/2608580f4b0251e8945e6e20e4c541dc.svg

---
Comment by @JagaranMaharjan on Dec 31, 2021
I am facing the same issue, do we have any solution?

---
Comment by @pansitwattana on Feb 7, 2022
Hello I also got this error. any update for this ?

---
Comment by @sebapastore on Mar 11, 2022
I have the same issue, caused by: ''stroke-width="1pt". If I remove de "pt" from the vector file, it works.

---
Comment by @ on May 5, 2022
Did anyone solve the problem?

I have the following error: 
The following XmlParserException was thrown resolving a single-frame picture stream:
<!DOCTYPE expected at 208:5

---
Comment by @joseph-lewis on Sep 21, 2023
I'm still getting this at the end of 2023... Is there a fix? Getting it from one or both of these SVG's only sometimes...

Svg1:
```
<svg enable-background="new 0 0 1024 1024" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
    <path d="m932.19 421.19c0-232.07-188.13-420.19-420.19-420.19s-420.19 188.12-420.19 420.19c0 115.56 45.69 219.25 121.19 295.21l292.04 298.49c12.51 11.23 31.61 10.74 43.53-1.12l263.18-298.14c75.5-75.96 120.44-178.88 120.44-294.44z" fill="#000000"/>
    <path d="m617.25 639.54h6.51 17.62 8.69c8.64 0 17.68-3.31 17.68-16.51v-4.59c0-.02.06-.08.06-.11v-8.91c0-3.19 2.4-5.68 5.54-6.22 27.99-4.84 49.5-32.08 49.5-64.83v-183.85h16.02c7.47 0 13.53-6.06 13.53-13.53v-64.97c0-5.63-3.44-10.44-8.34-12.48l-21.21-8.99v-6.47c0-30.21-18.34-55.5-43.12-63.09-.32-.13-.53-.29-.95-.4-.13-.03-.31-.08-.44-.12-.64-.18-1.26-.36-1.91-.51-15.34-4.16-56.91-15.93-152.14-17.4-.09 0-.19 0-.28-.01-2.58-.04-5.18-.07-7.84-.1-1.62-.02-3.26-.06-4.88-.06-.94 0-1.89.03-2.83.03-3.43-.01-6.72-.05-10.28-.03-111.68.52-155.31 17.89-163.24 21.53-.18.09-.37.16-.55.26-.55.26-.93.45-.93.45l.07.09c-19.91 10.47-33.79 33.08-33.79 59.35v118.88h-14.61c-7.47 0-13.53 6.06-13.53 13.53v64.97c0 5.7 3.55 10.53 8.53 12.52l19.61 8.31v72.07c0 32.44 21.09 59.46 48.68 64.68 3.1.59 5.44 3.06 5.44 6.21v13.77c0 13.2 9.04 16.51 17.68 16.51h32.82c10.81 0 16.84-5.64 16.84-16.03v-13.17c0-3.53 2.86-6.39 6.39-6.39h162.46 3.97c3.53 0 6.39 2.86 6.39 6.39v13.17c0 10.42 6.03 16.05 16.84 16.05zm79.75-121.4c-15.47 15.74-82.4 18.4-89.94 6.76-7.54-11.65 5.47-29.77 22.53-41.85 18.03-12.75 53.8-31.65 67.41-20.86 10.17 8.08 9.22 46.56 0 55.95zm-273.19 6.76c-7.54 11.64-74.47 8.98-89.94-6.76-9.22-9.39-10.17-47.88 0-55.95 13.61-10.79 49.38 8.11 67.41 20.86 17.06 12.08 30.07 30.2 22.53 41.85zm151.07 51.58h-120.03c-7.19 0-13.02-5.83-13.02-13.02s5.83-13.02 13.02-13.02h120.03c7.19 0 13.02 5.83 13.02 13.02s-5.83 13.02-13.02 13.02zm-63.32-130.11c-63.94 0-124.32-15.53-172.37-44.03-6.71-3.98-10.63-11.41-10.63-19.22v-134.7c0-18.71 366-18.71 366 0v134.74c0 7.79-3.91 15.19-10.6 19.17-48.06 28.51-108.45 44.04-172.4 44.04z" fill="#fff"/>
</svg>
```

```
Svg2:
<?xml version="1.0" encoding="utf-8"?>
<svg width="1024" height="1024" enable-background="new 0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
  <g transform="matrix(1, 0, 0, 1, 5.359098, -4.335575)">
    <title>Layer 1</title>
    <path id="svg_1" fill="#000000" d="m932.19,421.19c0,-232.07 -188.13,-420.19 -420.19,-420.19s-420.19,188.12 -420.19,420.19c0,115.56 45.69,219.25 121.19,295.21l292.04,298.49c12.51,11.23 31.61,10.74 43.53,-1.12l263.18,-298.14c75.5,-75.96 120.44,-178.88 120.44,-294.44z"/>
    <text transform="matrix(23.885 0 0 24.3478 -7916.98 -9373.89)" stroke="null" text-anchor="start" font-family="Arial, sans-serif" font-size="10" stroke-width="0" id="svg_3" y="406.90386" x="338.97323" fill="#FFFFFF" style="white-space: pre;">Text</text>
  </g>
</svg>
```