hoverColor property

Color? hoverColor
final

The color for the button when a pointer is hovering over it.

If ThemeData.useMaterial3 is set to true, this hoverColor will be mapped to be the ButtonStyle.overlayColor in hovered state, which paints on top of the button, as an overlay. Therefore, using a color with some transparency is recommended. For example, one could customize the hoverColor below:

IconButton(
  hoverColor: Colors.orange.withOpacity(0.3),
  icon: const Icon(Icons.ac_unit),
  onPressed: () {
    // ...
  },
)

Defaults to ThemeData.hoverColor of the ambient theme.

Implementation

final Color? hoverColor;