Skip to content
pubscout

date_field

7.0.0, released 3 months ago by gaspardmerten.dev

A form field widget for picking dates and times with adaptive Material and Cupertino dialogs

WASM-readyUses material_ui
$ flutter pub add date_field
Source repository

What it does

Provides DateTimeField and DateTimeFormField widgets that let users select a date, time, or both. It also offers global functions to show adaptive, Material, or Cupertino pickers directly.

AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a date or time picker inside a form
  • You want platform‑adaptive dialogs without custom implementation
  • You want to disable the field via an enabled flag

Skip it when

  • You need a custom picker UI that differs from the standard Material/Cupertino styles
  • You are building a non‑Flutter project

Strengths

  • Easy to integrate with Flutter forms
  • Supports both Material and Cupertino styles out of the box
  • Offers global functions for standalone pickers
  • Provides an enabled flag to disable the field

Weaknesses

  • Limited to date/time selection only
  • No support for custom picker themes beyond basic decoration
  • Requires intl for locale handling

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Add date_field to pubspec, run flutter pub get, import package, optionally call findSystemLocale() for locale support

DateTimeFormField(
  decoration: const InputDecoration(labelText: 'Select date'),
  firstDate: DateTime.now(),
  lastDate: DateTime.now().add(const Duration(days: 365)),
  onChanged: (value) => print(value),
)

Alternatives

Packages that do the same job and could replace date_field.

Works with

Packages commonly used together with date_field: ones it builds on, ones built on it, and its own family.