Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 755 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I set the animation color of a LinearProgressIndicator?

#1
The [LinearProgressIndicator documentation][1] helpfully displays the existence of a valueColor property and even mentions "To specify a constant color use: new AlwaysStoppedAnimation<Color>(color).", but if I try to set the color I get an error that LinearProgressIndicator has no instance setter for valueColor and the constructor for the class only accepts a key and a numerical value for the progress amount.

If I want a LinearProgressIndicator with a custom color do I need to create my own class? Is there really no way to specify this?

[1]:

[To see links please register here]

Reply

#2
Looks like it's controlled from the Theme's accent color:

[To see links please register here]


Wrap the relevant subtree in a modified Theme setting the accentColor to whatever you might like.
Reply

#3
I think you can provide in the below way,

LinearProgressIndicator( valueColor: AlwaysStoppedAnimation<Color> (Color(0xFFA86E52)),),
Reply

#4
If you want to set a constant color you can use :

```dart
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
)
```
Reply

#5
```dart
LinearProgressIndicator(
backgroundColor: Color(0xFFB4B4B4),
valueColor: AlwaysStoppedAnimation<Color>(Colors.green),
)
```
Reply

#6


LinearProgressIndicator(
backgroundColor: Colors.black,
valueColor: AlwaysStoppedAnimation<Color>(Colors.yellow) ,
color: Colors.red,
minHeight: 10,
),
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through