使用 Flutter:为什么 Rive 在使用 Liquid_Swipe 时渲染第一个动画而不是任何后续动画?

Using Flutter: Why does Rive render the first animation used over any subsequent animations when using Liquid_Swipe?

给出下面的基本示例,当您开始滑动并显示下一个容器时,它的动画会正确显示,但是一旦页面完全显示,动画就会被第一个容器的动画替换(因此微笑会显示在显示期间向上,但一旦完全显示,它立即被球取代),无论 'pages' 的数量如何,前 2 个动画是唯一显示的两个动画,第一个动画最终将是显示一次的动画页面已完全显示 - 我没有说明什么? - 请谢谢。

  rive: ^0.8.4
  liquid_swipe: ^2.1.1
class _MyHomePageState extends State<MyHomePage> {
  final pages = [
    Container(
      color: Colors.purple,
      child: Center(
        child: RiveAnimation.asset(
          "assets/Ball.riv",
          controllers: [SimpleAnimation('Ball', autoplay: true)],
          artboard: 'Ball',
          animations: const ['Ball'],
          fit: BoxFit.scaleDown,
        ),
      ),
    ),
    Container(
      color: Colors.orange,
      child: Center(
        child: RiveAnimation.asset(
          "assets/Smile.riv",
          controllers: [SimpleAnimation('Smile', autoplay: true)],
          artboard: 'Smile',
          animations: const ['Smile'],
          fit: BoxFit.scaleDown,
        ),
      ),
    ),
  ];

  @override
  Widget build(BuildContext context) => Scaffold(
    body: LiquidSwipe(
      enableSideReveal: true,
      waveType: WaveType.liquidReveal,
      slideIconWidget: const Icon(Icons.arrow_back_rounded, color: Colors.white),
      pages: pages,
    ),
  );
}

显然我是 Flutter 的新手...

解决方案:

SizedBox( key: UniqueKey(),

移动有状态的小部件 - 我需要唯一的键