Search code examples
flutterflutter-animation

How to add linear gradient to LinearProgressIndicator?


How can you add a LinearGradient to a LinearProgressIndicator?

This is what I have now:

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

Instead of a colour I would like to use a linear gradient. Is it possible?


Solution

  • You can use the gradient_widgets package which has a GradientProgressIndicator that is what I belive you're looking for.

    Than you can use like so

    GradientProgressIndicator(
                      gradient: Gradients.rainbowBlue,
                    );