如何为LinearProgressIndicator添加线性渐变?

时间:2019-02-24 19:39:43

标签: flutter flutter-animation

如何将LinearGradient添加到LinearProgressIndicator?

这就是我现在拥有的:

LinearProgressIndicator(
 value: 0.3,
 valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
)

我想使用线性渐变代替颜色。 有可能吗?

2 个答案:

答案 0 :(得分:1)

您可以使用GradientProgressIndicator的{​​{3}}软件包,这正是我所寻找的。

比你可以像这样使用

GradientProgressIndicator(
                  gradient: Gradients.rainbowBlue,
                );

答案 1 :(得分:1)

这不完全是问题的答案,但请查看 https://pub.dev/packages/step_progress_indicator(提出问题时似乎不存在)。

来自他们的页面:

enter image description here

相关问题