You can copy paste run full code below
You can in Icon
's color
add condition color: selectionIsActive ? null: Colors.white
code snippet
IconButton(
disabledColor: Colors.redAccent,
icon: Icon(
Icons.hdr_enhanced_select,
color: selectionIsActive ? null: Colors.white,
),
iconSize: 30,
onPressed: selectionIsActive
? null
: () {
setState(() {
selectionIsActive = true;
});
}),
working demo

full code
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool selectionIsActive = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
disabledColor: Colors.redAccent,
icon: Icon(
Icons.hdr_enhanced_select,
color: selectionIsActive ? null: Colors.white,
),
iconSize: 30,
onPressed: selectionIsActive
? null
: () {
setState(() {
selectionIsActive = true;
});
}),
],
),
),
);
}
}