Flutter 线性投影指示器颜色
如果我使用以下代码创建小部件:Flutter 线性投影指示器颜色,flutter,Flutter,如果我使用以下代码创建小部件: child: new Row(children: <Widget>[ new Expanded( child: LinearProgressIndicator(value: _animation.value, valueColor: AlwaysStoppedAnimation<Color>(Colors.white)), ), ]), 子项:新行(子项:[ 新扩展( 子项:LinearPr
child: new Row(children: <Widget>[
new Expanded(
child: LinearProgressIndicator(value: _animation.value, valueColor: AlwaysStoppedAnimation<Color>(Colors.white)),
),
]),
子项:新行(子项:[
新扩展(
子项:LinearProgressIndicator(值:_animation.value,值Color:AlwaysStoppedAnimation(Colors.white)),
),
]),
我以后如何访问设置程序来修改,例如LinearProgressIndicator值或valueColor?您必须调用
setState
进行更改
child: LinearProgressIndicator(value: _animation.value, valueColor: AlwaysStoppedAnimation<Color>(colorValue))
实际上,也可以有其他解决方案,例如,创建用于显示进度的自定义小部件,使用FutureBuilder或StreamBuilder。设置状态-这是更改某些内容最简单的方法那么,您是否检查了答案,找到了您要查找的内容?
setState((){
colorValue = /* new color */
});