Skip to content

showDatePicker manual input does not support inputFormatters #181043

Closed
flutter/packages
#12608

Description

@thomasfranke

Use case

Allow customization of the manual input field in showDatePicker

Problem

When using showDatePicker with DatePickerEntryMode.input or inputOnly, the manual date entry field does not expose any way to customize text input behavior.

Specifically, it is not possible to provide:

  • TextInputFormatter (e.g. input masks like dd/MM/yyyy)
  • A custom TextEditingController
  • Any hook or builder to customize the internal TextField

This makes it impossible to enforce locale-specific date formats or guide users while typing.


Why this is an issue

  • Many locales rely on strict date formats (e.g. dd/MM/yyyy in most of the world)
  • Free text input easily leads to invalid or ambiguous dates
  • Developers are forced to disable manual input entirely (calendarOnly) or reimplement a custom date picker
  • This breaks consistency with TextField, which already supports formatters and controllers

This is not a bug, but a limitation in the current API that affects extensibility and usability.


Current workaround

  • Disable manual input using DatePickerEntryMode.calendarOnly, or
  • Build a fully custom date picker, losing native Material UX and accessibility benefits

Flutter version

Flutter 3.38.7 • channel stable
Tools • Dart 3.10.7 • DevTools 2.51.1

Image of the Issue

The screenshot below shows the manual date input mode in showDatePicker, where the text field does not apply any input mask or formatting, allowing free-form input that can lead to invalid or ambiguous dates.

Image

Proposal

Provide a way to add/customize the manual input field used by showDatePicker, for example:

  • Allow passing custom TextInputFormatter instances.
  • Allow providing a TextEditingController.
  • Or expose a builder or callback to customize the internal input field.

Optionally, the framework could offer a locale-aware date input formatter that developers may choose to use.

This would allow developers to keep the native Material date picker while enforcing proper input formats.

Activity

  1. Mairramer commented on Jan 16, 2026

    @Mairramer
    Contributor

    Proposal

    Provide a way to add/customize the manual input field used by showDatePicker, for example:

    • Allow passing custom TextInputFormatter instances.
    • Allow providing a TextEditingController.
    • Or expose a builder or callback to customize the internal input field.

    Optionally, the framework could offer a locale-aware date input formatter that developers may choose to use.

    This would allow developers to keep the native Material date picker while enforcing proper input formats.

    I agree that we should allow overriding or adding custom InputFormatters. However, I believe it would be better to provide a set of predefined DateInputFormats.

    In practice, we will usually use dd/MM/yyyy or MM/dd/yyyy (depending on the locale), yyyy-MM-dd (ISO 8601), and in some cases dd-MM-yyyy. Less commonly, dd.MM.yyyy may also be needed.

    In addition, the internal parser must be updated accordingly to ensure that existing behavior does not break and no unexpected or inconsistent parsing occurs.

  2. Mairramer commented on Jan 16, 2026

    @Mairramer
    Contributor

    @tirth-patel-nc Perhaps this is a duplicate of #97134?

  3. tirth-patel-nc commented on Jan 16, 2026

    @tirth-patel-nc
    Member

    @thomasfranke please confirm whether #97134 #62401 #83302 are matches your case?

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 16, 2026
  5. github-actions commented on Feb 6, 2026

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  6. github-actions commented on Feb 20, 2026

    @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.

  7. locked as resolved and limited conversation to collaborators on Feb 20, 2026
  8. added a commit that references this issue on Sep 10, 2026
    c437326
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

    in triagePresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions