Svg image not showing in flutter

Viewed 5423

SvgPicture.asset('assets/images/close_icon.svg', color: Colors.white,)

not showing image. output error is

The following StateError was thrown resolving a single-frame picture stream:

Bad state: Could not parse "currentColor" as a color.

3 Answers

You can open your svg asset assets/images/close_icon.svg and edit color property from currentColor to any other valid color (like black or white).

const svg = 'assets/logo.svg';

// If want to show orginal svg color use this

SvgPicture.asset(svg, 
   semanticsLabel: 'My SVG Picture' 
);

// If want to change the color use color properties

SvgPicture.asset(svg, 
   color: Colors.black, 
   semanticsLabel: 'My SVG Picture' 
);
Related