Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cannot add svg image in NetworkImage in Flutter"

Tags:

flutter

dart

I am trying to add NetworkImage inside Container but when I add .svg image I get error but it works for the other formats like .png, .jpeg, etc

Container(
 decoration: BoxDecoration(
  image: DecorationImage(
  image: NetworkImage("https://upload.wikimedia.org/wikipedia/en/e/eb/Manchester_City_FC_badge.svg")
 )
)

Error:

E/flutter (22336): [ERROR:flutter/lib/ui/painting/codec.cc(97)] Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
like image 292
Abishek Bashyal Avatar asked Jan 22 '26 22:01

Abishek Bashyal


1 Answers

Flutter Doesn't support svg format yet (issue).

You can use flutter_svg 0.13.0+2, a library to load and show svg files

like image 149
shb Avatar answered Jan 25 '26 10:01

shb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!