flutter icon button on pressed code example
Example 1: icon onpressed flutter
IconButton( icon: Icon(Icons.bluetooth), color: Colors.grey, highlightColor: Colors.red, hoverColor: Colors.green, focusColor: Colors.purple, splashColor: Colors.yellow, disabledColor: Colors.amber, iconSize: 48, onPressed: () { setState(() { _isBluetoothOn = !_isBluetoothOn; }); }, ),
Example 2: onpressed icon flutter
final VoidCallback onPressed