如何缩放Flare动画以适合卡片宽度?

时间:2020-07-06 17:17:37

标签: flutter flutter-layout rive

我有一个带有卡片的简单堆叠,其上是Flare动画。我希望动画适合卡片的宽度并与卡片的底部对齐。实际上,它仅覆盖大约三分之一的卡,并且几乎位于中间。有什么想法可以缩放动画以覆盖卡片的宽度并对齐动画吗?

我尝试了fit:Boxfit.cover,fit:BoxFit.fitWidth等,但没有任何改变。

这是我的代码:

Stack(
          children: <Widget>[
            Card(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(24.0),
              ),
              color: Colors.white,
              elevation: 4.0,
              shadowColor: Colors.grey,
              child: Column(
                children: <Widget>[
                  Text(
                    'DASHBOARD',
                    style: TextStyle(
                      fontSize: 20.0,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  StepProgressIndicator(
                    totalSteps: 14,
                    currentStep: 10,
                    size: 20,
                    selectedColor: Colors.orange,
                    unselectedColor: Colors.green,
                    roundedEdges: Radius.circular(10),
                  ),
                ],
              ),
            ),
            FlareActor(
              'assets/animations/liquid_animation.flr',
              fit: BoxFit.cover,
              animation: liquidAnimation,
            ),
          ],
        ),

enter image description here

0 个答案:

没有答案