flutter IconButton change color onPressed
class SomeState extends State<StatefulWidget> {
Color _iconColor = Colors.white;
@override
Widget build(BuildContext) {
return ListTile(
leading: new IconButton(
icon: Icon(Icons.star, color: _iconColor),
onPressed: () {
setState(() {
_iconColor = Colors.yellow;
});
},
);
}
}