valueColors property

List<ValueColor>? valueColors
final

根据值变化颜色的集合

int value = 9999; // or use Controller.value
AnimatedDigitWidget(
  value: value,
  textStyle: TextStyle(color: Colors.orange, fontSize: 30),
  valueColors: [
    ValueColor(
      //When value <= 0 , the color changes to red
      condition: () => value <= 0,
      color: Colors.red,
    ),
    // you can add more ...,but always take the last eligible.
  ],
),

Implementation

final List<ValueColor>? valueColors;