Issue Explanation
The reported error involves a runtime crash when the vector_graphics package attempts to draw an <image>
element from an SVG. The stack trace suggests a TypeError
is happening during onDrawImage
, likely due to the decoding of image bytes into a Dart/Flutter UI image object not producing the expected type.
Prior to Flutter 3.10, decodeImageFromList
was the conventional method to decode images from byte arrays. However, with updated Flutter versions and web compatibility changes, decodeImageFromList
on the web may not return the expected ui.Image
type, causing type errors at runtime. Instead, it's recommended to use the newer image decoding approach that involves ImmutableBuffer
, ImageDescriptor
, and Codec
.
Root Cause
- The
onDrawImage
method in FlutterVectorGraphicsListener
is expecting a ui.Image
, but the decoding method used might be returning something else or failing silently, leading to a TypeError
.
- If the code previously relied on `decodeImageFrom