Skip to content

showDatePicker manual input does not support inputFormatters #181043

@thomasfranke

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer 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