可以将RiveAnimation.asset放在Stack中,并将其放在悬浮按钮的下面,如下所示:

Stack( children: [ // Rive Animation RiveAnimation.asset( 'assets/birds.riv', animations: const [ 'Fly2', ], ), // Floating Action Button Positioned( bottom: 16, right: 16, child: FloatingActionButton( tooltip: '回到今天', onPressed: () { hItems(DateTime.now()); setState(() { print('回到今天'); _calendarAgendaControllerAppBar.goToDay(DateTime.now()); }); }, child: Text('回到\n今天', style: TextStyle( color: Colors.white, fontSize: 13, ) ), backgroundColor: Global.home_currentcolor, ), ), ], )

这样,Rive Animation就会显示在悬浮按钮的下面。您可以使用Positioned小部件来调整动画的位置

怎么让动画 RiveAnimationasset assetsbirdsriv animations const Fly2

原文地址: http://www.cveoy.top/t/topic/flyB 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录