How to use Linear Indicator dynamic stock values

86 views Asked by At

I want linear indicator for dynamic values how to use condition in stock details and color values

enter image description here

1

There are 1 answers

0
Ravi Patel On BEST ANSWER

You can try this.

double stockValue = 0.5; // update stock value 
LinearProgressIndicator(
   backgroundColor: const Color(0xFFB4B4B4),
   valueColor: AlwaysStoppedAnimation<Color>(stockValue == 1?Colors.red:Colors.green),
   value: stockValue,
),