overlayColor property

MaterialStateProperty<Color?>? overlayColor
final

Defines the ink response focus, hover, and splash colors.

If non-null, it is resolved against one of MaterialState.focused, MaterialState.hovered, and MaterialState.pressed.

MaterialState.pressed triggers a ripple (an ink splash), per the current Material Design spec.

If the overlay color is null or resolves to null, then if ThemeData.useMaterial3 is false, the default values for InkResponse.focusColor, InkResponse.hoverColor, InkResponse.splashColor, and InkResponse.highlightColor will be used instead. If ThemeData.useMaterial3 if true, the default values are:

  • selected:
    • pressed - ThemeData.colorScheme.primary(0.1)
    • hovered - ThemeData.colorScheme.primary(0.08)
    • focused - ThemeData.colorScheme.primary(0.1)
  • pressed - ThemeData.colorScheme.primary(0.1)
  • hovered - ThemeData.colorScheme.onSurface(0.08)
  • focused - ThemeData.colorScheme.onSurface(0.1)

Implementation

final MaterialStateProperty<Color?>? overlayColor;