【问题标题】:My flutter Svg looks crispy and i dont know how to fix it我的颤振 Svg 看起来很脆,我不知道如何解决它
【发布时间】:2022-01-20 05:34:04
【问题描述】:

我使用flutter_svg: ^0.22.0包来显示svg标志,我选择svg的原因是因为我希望它能够缩放到不同的屏幕,但是当我上传它时,它看起来很脆,我需要当我用 Chrome 打开 SVG 文件时,它看起来很流畅

这是我的代码:

  Container(
                width: MediaQuery.of(context).size.width,
                height: MediaQuery.of(context).size.height * 10 / 100,
                child: Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Container(
                          width: MediaQuery.of(context).size.width *
                              30 /
                              100,
                          height: MediaQuery.of(context).size.height,
                          child: Container(
                              width:
                                  MediaQuery.of(context).size.height *
                                      10 /
                                      100,
                              height:
                                  MediaQuery.of(context).size.height *
                                      10 /
                                      100,
                              child: SvgPicture.asset(
                                'assets/images/logo.svg',
                                semanticsLabel: 'User Id',
                              ))),
                    ]))

这是下面的清晰图像,我该如何解决这个问题

【问题讨论】:

    标签: flutter svg


    【解决方案1】:

    您能否尝试删除 container,它是您包装 SVG 的小部件。之后在SVG.asset中给它高度和宽度

    【讨论】:

      猜你喜欢
      • 2019-06-01
      • 2020-10-31
      • 1970-01-01
      • 2015-12-17
      • 2021-10-26
      • 2020-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多