Here's what I have...
IconButton(icon: Icon (Icons.bookmark_outline, color: Color(0xFF192A4F),),
onPressed: () => Icons.bookmark, color: Color(0xFF192A4F),),
I don't know what I'm doing. All I've been able to find is this
how to fill color of IconButton in Flutter
but I couldn't get that to work.
I just want the icon to change when tapped... I'm new.
What worked:
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
bool outline = false;
@override
Widget build(BuildContext context) {
return DefaultTabController(
Row(
children: <Widget>[
IconButton(icon: Icon(outline ? Icons.bookmark_outline : Icons.bookmark),
onPressed:(){
setState((){
outline = !outline;
});
}
),
SizedBox(width: 8.0),
Text('Bookmark', style: TextStyle(color: Color(0xFF192A4F)),),
],
),