代码之家  ›  专栏  ›  技术社区  ›  BIS Tech

光斑未设置动画

  •  0
  • BIS Tech  · 技术社区  · 6 年前

    我在河上制造了闪光。但它不是动画。只显示图像。

    class CustomIntro extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return
    
          Column(
          children: <Widget>[
          Expanded(
              child: FlareActor(
                'assets/introduction.flr',
                  alignment:Alignment.center,
                  fit:BoxFit.contain,
                  animation:"introduction",
              )
          )
          ],
        );
      }
    }
    
    0 回复  |  直到 6 年前
        1
  •  2
  •   duongdt3    6 年前

    我猜这里的问题是错误的动画名称(每个Flare文件都有一些动画名称…)

    下面的例子

    class CustomIntro extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Column(
          children: <Widget>[
            Expanded(
                child: FlareActor(
              'res/favorite.flr',
              alignment: Alignment.center,
              fit: BoxFit.contain,
              animation: "Favorite", // or Unfavorite
            ))
          ],
        );
      }
    }
    

    请更正并重试。

        2
  •  2
  •   BIS Tech    6 年前

    你可以看到 动画 rive.app上的边栏。将此名称添加到颤振代码中。

       FlareActor(
                  "assets/Introduction.flr",
                  alignment: Alignment.center,
                  fit: BoxFit.contain,
                  animation: "go",
                )
    

    enter image description here