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
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.
- omni_datetime_picker
A datetime picker package with option for a single datetime picker or a datetime range picker.
87Compare - flutter_country_selector
A country picker widget to select a country, now re-exported from phone_form_field.
75Compare - advanced_forms
Flutter form validation and state management with typed controllers and validators.
85Compare - duration_picker
A time picker widget for selecting hours and minutes as durations.
86Compare
Works with
Packages commonly used together with date_field: ones it builds on, ones built on it, and its own family.
- intldate_field depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- material_uidate_field depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- cupertino_uidate_field depends on itOfficial Flutter Cupertino design library implementing Apple HIG iOS and macOS user interfaces.
- flutter_date_range_pickerSame familyFlutter package for selecting date ranges with calendar, dialog, and form field options.
- nylo_supportBuilt on date_fieldSupport library for the Nylo framework offering routing, networking, storage, widgets and more.
- nylo_frameworkBuilt on date_fieldMicro-framework for Flutter with boilerplate, routing, MVC pattern, and CLI tooling.