File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
example/lib/shared/widgets/universal Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ class _SvgAssetImageState extends State<SvgAssetImage> {
5050 late String svgString;
5151
5252 Future <SvgPicture > _coloredUndrawImage (bool load, Color color) async {
53+ // Convert the color to a HEX RGB string without the alpha value.
54+ final String valueString =
55+ color.value.toRadixString (16 ).padLeft (8 , '0' ).substring (2 );
5356 if (load) assetSvgString = await rootBundle.loadString (widget.assetName);
54- String valueString = color.toString ().split ('(0x' )[1 ].split (')' )[0 ];
55- valueString = valueString.substring (2 , valueString.length);
5657 // Find the default image 'theme' color in the Undraw SVG, and replace
5758 // the color with another color string value we want to use instead.
5859 // We store the original bundle asset and change colors on the original
You can’t perform that action at this time.
0 commit comments