Skip to content

Adding week type to the CupertinoDatePicker #171332

Closed

Description

@koukibadr

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

  1. EedupugantiVenkatesh commented on Jun 29, 2025

    @EedupugantiVenkatesh

    Hi, I would like to work on this issue. I propose adding a selectableDateFilter function that allows developers to restrict selectable dates within the CupertinoDatePicker. Let me know if this approach is acceptable.

  2. koukibadr commented on Jun 29, 2025

    @koukibadr
    ContributorAuthor

    @EedupugantiVenkatesh There's already an active PR for this, to solve this issue I've used customWeekDays list attribute that will hold the available week days to pick from
    by default weekDays will contain all weekday int values (from Monday to Sunday) with static presets
    for more context check the PR and check this comment

  3. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: cupertino_uicupertino_ui package in flutter/packages
    c: proposalA detailed proposal for a change to Flutter
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Jun 30, 2025
  4. added
    P3Issues that are less important to the Flutter project
    triaged-designTriaged by Design Languages team
    on Jul 2, 2025
  5. sachin-rai1 commented on Jul 7, 2025

    @sachin-rai1

    Hi, I’d like to work on this issue. Is it available?

  6. koukibadr commented on Jul 7, 2025

    @koukibadr
    ContributorAuthor

    @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

  7. ksokolovskyi commented on Oct 15, 2025

    @ksokolovskyi
    Contributor

    Closing as resolved by #171334

  8. added
    r: fixedIssue is closed as already fixed in a newer version
    and removed
    r: solvedIssue is closed as solved
    on Oct 17, 2025
  9. github-actions commented on Oct 31, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 widgetsframeworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-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