Balaji Ks
Balaji Ks

Reputation: 342

Flutter: SVG Image in the background throws an error

I have to keep the SVG Image in the background and keep the Text in the top. When I'm keeping the SVG Image from the Flutter_SVG Package, I got a error like this.

I/flutter (24437): Unsupported operation: Could not resolve image href: Component%206%20-%201-image.png

Picture provider: ExactAssetPicture(name: "assets/images/login_header.svg", bundle: null,
I/flutter (24437):   colorFilter: ColorFilter.mode(MaterialColor(primary value: Color(0xfff44336)), BlendMode.srcIn))
I/flutter (24437): Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#32e52(), name:
I/flutter (24437):   "assets/images/xxx.svg", colorFilter: ColorFilter.mode(MaterialColor(primary value:
I/flutter (24437):   Color(0xfff44336)), BlendMode.srcIn))

Upvotes: 7

Views: 9244

Answers (5)

Muhammad Hassan Osama
Muhammad Hassan Osama

Reputation: 33

Do this flutter clean && flutter pub get

Upvotes: 0

Son Nguyen
Son Nguyen

Reputation: 4406

I was able to fix this by dragging and dropping the svg files to the Figma design tool and then export all of them to get the standard error-free svg files.

Upvotes: 0

Ariel E. Cavadia
Ariel E. Cavadia

Reputation: 19

Download SVG CLEANER "Download" and clean the files, then open the .SVG in a text editor and change the following:

and add

That should be enough, I have had this problem several times and only then has it been fixed.

Upvotes: 1

Balaji Ks
Balaji Ks

Reputation: 342

Need to clear the caches from SVG Image. It can be done by SVGCleaner and that's will work in our project.

Upvotes: 1

Balaji Venkatraman
Balaji Venkatraman

Reputation: 1339

flutter_svg package that you use does not support filter effects.Sadly this is not possible with the current version of the package.This would be possible only.

Anyway one of the hacks (Crappy workaround)

  • Converting shadows to bitmap(not correct solution)

Follow the issue on Github Issues. Hoping the feature will be available soon as said by the developer of the package

Upvotes: 1

Related Questions