Repository navigation
Adding week type to the CupertinoDatePicker #171332
Description
Use case
Currently, the CupertinoDatePicker widget displays all calendar days by default, allowing users to select any date presented.
While developers can implement logic on the application side to validate or filter selected dates, there's no native mechanism within the widget itself to disable or block specific dates from being presented as selectable options to the user.
This limitation presents a challenge for common application scenarios where users should only be able to interact with a predefined subset of dates. For instance, an appointment booking application needs to guide users to available slots, such as only weekdays or specific dates not marked as holidays or fully booked.
Without native support for disabling dates, developers must display all days, potentially leading to a poor user experience, or implement complex, error-prone filtering logic on the application side to prevent selection of unavailable dates.
Proposal
To address this, I propose introducing a new parameter, weekType, to the CupertinoDatePicker widget.
This parameter would offer a declarative way to control the set of selectable days displayed in the picker, with options such as WeekType.workDays (Monday-Friday), WeekType.weekends (Saturday-Sunday), WeekType.fullWeek (all days), or WeekType.custom. For the WeekType.custom option, developers would provide a List representing the DateTime.weekday values that should be visible and selectable.
Activity
EedupugantiVenkatesh commentedon Jun 29, 2025
Hi, I would like to work on this issue. I propose adding a
selectableDateFilterfunction that allows developers to restrict selectable dates within the CupertinoDatePicker. Let me know if this approach is acceptable.koukibadr commentedon Jun 29, 2025
@EedupugantiVenkatesh There's already an active PR for this, to solve this issue I've used
customWeekDayslist attribute that will hold the available week days to pick fromby default
weekDayswill contain all weekday int values (from Monday to Sunday) with static presetsfor more context check the PR and check this comment
sachin-rai1 commentedon Jul 7, 2025
Hi, I’d like to work on this issue. Is it available?
koukibadr commentedon Jul 7, 2025
@sachin-rai1 there's an active PR resolving this issue, the proposed solution adds a new attribute to the DatePicker cupertino widget but the enhanced solution is to use a predicate callback similar to the material design date picker, I'm working on it
feat(cupertino): Add selectableDayPredicate parameter to CupertinoDat…
ksokolovskyi commentedon Oct 15, 2025
Closing as resolved by #171334
github-actions commentedon Oct 31, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.