I want to change the color of the text displaying the scheduled time, if the scheduled time is past the current time then it should change to red and if its in the future then it wont change. This works properly but it only changes state when I click on another button. I am using a ternary operator like this:
color: (run(todoController.todos[index].date,
todoController.todos[index].time)
.compareTo(tz.TZDateTime.now(tz.local))>0)
? Theme.of(context).hintColor
: Colors.redAccent,
How do you add setState in a ternary operator? Thanks