SVG图片尽管抖动仍会提供彩色图像,但仍会在抖动中返回黑色图像 [英] SVG picture is returning black image in flutter inspite of giving a color image from assests

查看:87
本文介绍了SVG图片尽管抖动仍会提供彩色图像,但仍会在抖动中返回黑色图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我要添加svgpicture但我得到黑色图像的代码 新货柜 子级:new SvgPicture.asset('assets/camera.svg') ),

here is the code where i m going to add the svgpicture but i m getting black image new Container child: new SvgPicture.asset('assets/camera.svg') ),

这是我的camera.svg文件

this is mine camera.svg file

<svg xmlns="http://www.w3.org/2000/svg" width="13.607" height="13.608" viewBox="0 0 13.607 13.608">
    <defs>
        <style>
            .cls-1{}
        </style>
    </defs>
    <g id="Group_5" data-name="Group 5" transform="translate(-57.8 -130.498)">
        <g id="Group_4" data-name="Group 4">
            <g id="Group_3" data-name="Group 3">
                <path id="Path_2" d="M69.415 139.294a6.792 6.792 0 0 0-2.586-1.621 3.933 3.933 0 1 0-4.452 0 6.814 6.814 0 0 0-4.577 6.433h1.063a5.741 5.741 0 1 1 11.481 0h1.063a6.763 6.763 0 0 0-1.992-4.812zM64.6 137.3a2.87 2.87 0 1 1 2.87-2.87 2.874 2.874 0 0 1-2.87 2.87z" class="cls-1" data-name="Path 2"/>
            </g>
        </g>
    </g>
</svg>

推荐答案

flutter_svg 无法理解内部或嵌入式CSS .

因此,您需要删除内部CSS并编写内联CSS.

Hence you need to remove the internal css and write inline css.

示例:- <path style="fill:#566e83;" ...

这篇关于SVG图片尽管抖动仍会提供彩色图像,但仍会在抖动中返回黑色图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆