更改 FortuneBar 中 FortuneItem 中项目的颜色 flutter_fortune_wheel 不可能吗?

问题描述 投票:0回答:1
我有一个 flutter 应用程序,我在其中使用的东西之一是 flutter_fortune_wheel 插件中的 FortuneBar 小部件。该插件支持使用“style:”属性直接自定义 FotuneBar,但由于某种原因,这不适用于该栏。小部件的代码是这样的:

return Scaffold( body: Container( decoration: const BoxDecoration( gradient: LinearGradient( colors: [ Color.fromRGBO(113, 250, 202, 1), Color.fromRGBO(60, 79, 118, 1), ], stops: [.30, .85], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), ), child: Column( children: [ const SizedBox( height: 170, ), Expanded( child: listManager.rewardsList.isNotEmpty && spinWheel ? Padding( padding: const EdgeInsets.only(top: 100), child: FortuneBar( styleStrategy: const AlternatingStyleStrategy(), selected: StreamController<int>.broadcast().stream, items: [ for (var reward in listManager.rewardsList) FortuneItem( child: Text(reward), ), ], )) : const Center( child: Text( 'Please enter 2 or more Rewards', style: TextStyle( fontSize: 25, fontWeight: FontWeight.bold, color: Color.fromARGB(255, 2, 4, 133), ), ), ), ), const Padding( padding: EdgeInsets.all(10), ), SpinButton( spinWheel: spinWheel, setSpinWheel: (bool value) { setState(() { spinWheel = value; }); }), const SizedBox(height: 100), ], ), ), );
我尝试了无数使用填充物、容器等的方法。没有什么真正有用的。任何帮助将不胜感激。谢谢!

flutter styling flutter-plugin
1个回答
0
投票
你需要设置样式策略。

styleStrategy: UniformStyleStrategy( 边框宽度:0, 颜色: Color.fromARGB(255, 111, 190, 255), borderColor: Color.fromARGB(255, 111, 190, 255)),

© www.soinside.com 2019 - 2024. All rights reserved.