dayOverlayColor property
final
Overrides the default highlight color that's typically used to indicate that a day in the grid is focused, hovered, or pressed.
This supports different colors based on the WidgetStates of the day button. The overlay color is usually used with an opacity to create hover, focus, and press effects.
dayOverlayColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.pressed)) {
return Colors.blue.withOpacity(0.12);
}
if (states.contains(WidgetState.hovered)) {
return Colors.blue.withOpacity(0.08);
}
if (states.contains(WidgetState.focused)) {
return Colors.blue.withOpacity(0.12);
}
return null; // Use the default color.
})
Implementation
final WidgetStateProperty<Color?>? dayOverlayColor;