highlightColor property Null safety

Color? highlightColor

The secondary color of the button when the button is in the down (pressed) state. The highlight color is represented as a solid color that is overlaid over the button color (if any). If the highlight color has transparency, the button color will show through. The highlight fades in quickly as the button is held down.

If ThemeData.useMaterial3 is set to true, this highlightColor will be mapped to be the ButtonStyle.overlayColor in pressed 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 highlightColor below:

  highlightColor: Colors.orange.withOpacity(0.3),

Defaults to the Theme's highlight color, ThemeData.highlightColor.


final Color? highlightColor;