Skip to content

Commit ca30773

Browse files
committed
FIX: Playground WASM SVG load
1 parent 8f871da commit ca30773

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/lib/shared/widgets/universal/svg_asset_image.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)