Flutter SVG rendering

后端 未结 7 566
花落未央
花落未央 2020-12-03 02:27

I tried adding an image with a SVG source to my flutter application.

new AssetImage(\"assets/images/candle.svg\"))

But I didn\'t get any visual

7条回答
  •  失恋的感觉
    2020-12-03 02:54

    Flutter does not currently support SVG. Follow issue 1831 for updates.

    If you absolutely need vector drawing you can see the Flutter Logo widget as an example of how to draw using the Canvas API, or rasterize your image on the native side and pass it to Flutter as a bitmap, but for now your best bet is probably to embed high-resolution rasterized asset images.

提交回复
热议问题