Skip to content

Separate properties for the selected day of the DatePicker #161052

@nickolasdeluca

Description

@nickolasdeluca

Use case

Currently the Flutter engine uses the dayOverlayColor to assign color to the selected day button. This is not intuitive and also limits the customization of the Date Picker, since the dayOverlayColor and dayBackgroundColor must be similar, since there is no way to select the color of the text of the selected day.

Imagine the following: I'm using a white background for all dates and a blue text color.

dayBackgroundColor: Colors.white,
dayForegroundColor: Colors.blue,

If I set the dayOverlayColor to Colors.blue, when the user selects a date, I'd have a round blue button with, what would appear to be, no text.

Proposal

I propose that we add the following properties:

selectedBackgroundColor and selectedForegroundColor

where both properties, similar to the ones we have today, control, respectively, the background and foreground colors of the button.

or

selectedDayTheme

where we could have a ButtonStyle to assign the colors.

I also propose that we standardize the other properties to be like the confirmButtonStyle, making it intuitive for the user to customize the dialog.

PS: the same thing should be done to the year buttons as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: date/time pickerDate or time picker widgetsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions