dnfield / flutter_svg

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

Uncaught Bad state: Invalid SVG data #967

Open fakhravari opened 1 year ago

fakhravari commented 1 year ago

pmlm-en

Screenshot 2023-07-21 211130 static const logoAppbar = 'assets/icons/pmlm-en.svg';

SvgPicture.asset( AppImagesAssets.logoAppbar, height: 55, color: Theme.of(context).colorScheme.primary, semanticsLabel: 'PMLM', )

fakhravari commented 1 year ago

help me

SangaraNaarayanan-tuts commented 8 months ago

bro did u find any solution this is occuring for me too

darthcodehero commented 7 months ago

hey

`const String svgNotifications = '''

''';`

SvgPicture.string( svgNotifications, width: 28, height: 28, ),

Mine is a normal svg but try it like that, it worked for me

hpelitebook745G2 commented 5 months ago

is there a callback at least that captures the error event so i could display a placeholder?

tonytrill commented 5 months ago

I was not getting this error locally on web, but was after deploying and building the app I was getting this error. What I found was I was referencing the svg as icons/my-icon.svg as opposed to assets/icons/my-icon.svg in my SvgPicture.asset(). Hope this helps.

Spiro94 commented 4 months ago

I was not getting this error locally on web, but was after deploying and building the app I was getting this error. What I found was I was referencing the svg as icons/my-icon.svg as opposed to assets/icons/my-icon.svg in my SvgPicture.asset(). Hope this helps.

Same issue, thanks for the solution.

pjarnfelt commented 4 days ago

Why is there no error handling on the SvgPicture object?!!