dayForegroundColor property

WidgetStateProperty<Color?>? dayForegroundColor
final

Overrides the default color used to paint the day labels in the grid of the date picker.

This will be used instead of the color provided in dayStyle.

This supports different colors based on the WidgetStates of the day button, such as WidgetState.selected, WidgetState.hovered, WidgetState.focused, and WidgetState.disabled.

dayBackgroundColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
  if (states.contains(WidgetState.selected)) {
    return Theme.of(context).colorScheme.primary;
  }
  return null; // Use the default color.
})

See also:

Implementation

final WidgetStateProperty<Color?>? dayForegroundColor;