I am developing a Flutter application where I need to display a human body silhouette with muscles, and I want users to dynamically color specific muscles based on their input. I am using the flutter_svg package to work with SVG images.
Here is a simplified version of the SVG representing the human body silhouette:
<path
id="muscle1"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
d="M 5000,0 H 0 V 5000 H 5000 V 0" />
and more like this.
In my Flutter app, I want to use SvgPicture to display this SVG image, and I want users to select a muscle (identified by its unique ID, e.g., "muscle1") and choose a color to fill that specific muscle.
I have considered using the SvgPicture.string method and applying color filters, but I'm uncertain about the best approach for dynamically coloring specific parts of the SVG.
Could someone provide guidance on how to achieve this in Flutter using the flutter_svg package? What is the recommended way to dynamically color specific muscles in a human body silhouette SVG based on user input?
Thank you for your assistance!
Just modify the content of your SVG file