Skip to content

Export CalendarDateRangePicker class at material public api #65108

Open

Description

@jhionan

Use case

My design created his own style range date picker, but since CalendarDateRangePicker class is not exported /material/pickers/pickers.dart (only the function showDateRangePicker) we can use this as a widget, so we can customize, com compose anything with this function.

image

Proposal

at /material/pickers/pickers.dart
add CalendarDateRangePicker together with showDateRangePicker
dart export 'date_range_picker_dialog.dart' show showDateRangePicker, CalendarDateRangePicker;

Activity

  1. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    on Sep 3, 2020
  2. thecalamiity commented on Sep 4, 2020

    @thecalamiity
    Contributor

    Just import 'calendar_date_range_picker.dart'. Not sure what the issue here is?

  3. moodstubos commented on Oct 16, 2020

    @moodstubos

    @jhionan simply use this import line:
    import 'package:flutter/src/material/pickers/calendar_date_range_picker.dart';

  4. jhionan commented on Oct 16, 2020

    @jhionan
    Author

    Just import 'calendar_date_range_picker.dart'. Not sure what the issue here is?

    When I propose this, calendar_date_range_picker was no accessible in public api of Flutter. It was inside the date_range_picker_dialog.

    In another issue asking why this was not public Darren Austin said duo deadlines it was not ready, and asked to create this issue.

    But I just test its solved.

  5. darrenaustin commented on Nov 15, 2020

    @darrenaustin
    Contributor

    Please don't import anything under a src directory directly. Those are internal implementation files and may change out from underneath you. The supported APIs are accessed by using import 'package:flutter/material.dart'. See the lib directory section of the packages guide for more detail.

    I am currently working on a PR that will restructure the date picker code and will be moving this file out of this location (see #69939 for more info). This or a subsequent PR will expose the CalendarDateRangePicker component as part of the public API with proper tests. If you import the current implementation from src, your app will break when this lands.

  6. self-assigned this
    on Nov 15, 2020
  7. fer-ri commented on Jan 1, 2021

    @fer-ri

    Please don't import anything under a src directory directly. Those are internal implementation files and may change out from underneath you. The supported APIs are accessed by using import 'package:flutter/material.dart'. See the lib directory section of the packages guide for more detail.

    I am currently working on a PR that will restructure the date picker code and will be moving this file out of this location (see #69939 for more info). This or a subsequent PR will expose the CalendarDateRangePicker component as part of the public API with proper tests. If you import the current implementation from src, your app will break when this lands.

    Any update for this? already 2021.

    Thanks

  8. pcsosinski commented on Jan 13, 2021

    @pcsosinski

    @darrenaustin are you planning to land this in 1.26? if not can you update the milestone please?

  9. brent-moffit commented on Mar 4, 2021

    @brent-moffit

    Now that #69939 has landed this is a bigger issue than it used to be. The new options for a builder and custom text in showDateRangePicker are nice, but it still doesn't provide the ability to do a custom transition or style the close/save buttons yourself. My app has a custom animation and container for dialogs and I would like to make the date range picker match the rest of the dialogs in my app.

  10. darrenaustin commented on Mar 4, 2021

    @darrenaustin
    Contributor

    Understood. I have it almost ready, but I ran into an issue with parameter updates that I found when writing unit tests. I have been meaning to get back to this and finish it up, but have had other priority issues. I will make an effort to get this in as soon as possible. Thanks for your patience.

  11. cedvdb commented on May 16, 2022

    @cedvdb
    Contributor

    @darrenaustin That PR has passed but it is not part of the public API. Is it still on the plate ?

    This or a subsequent PR will expose the CalendarDateRangePicker component as part of the public API with proper tests.

    The date widgets are really limiting in their api surface.

  12. added
    P3Issues that are less important to the Flutter project
    on Mar 12, 2025
  13. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
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: proposalA detailed proposal for a change to Flutterf: date/time pickerDate or time picker widgetsp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: 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