isSelected property

bool? isSelected
final

The optional selection state of the icon button.

If this property is null, the button will behave as a normal push button, otherwise, the button will toggle between showing icon and selectedIcon based on the value of isSelected. If true, it will show selectedIcon, if false it will show icon.

This property is only used if ThemeData.useMaterial3 is true.

Implementation

final bool? isSelected;