I want to change like button color if iconButton is pressed and when the listview is loading based on conditon iconButton color will be changed. I have a listview and in every row of listview i have a like iconButton. I need change the color from grey to blue onpress and When the listview will load again then i have whether liked before or not and based on this condition i have to change color.
new IconButton(
icon: new Icon(Icons.thumb_up),
color: Colors.grey,
onPressed: (){
documentId = list[index].id;
_incrementCounter();
},
),
how can i do this?
use a
ternary
operator.