Search packages, repositories and app categories

datepicker_dropdown cover
Package detailsv1.0.2

datepicker_dropdown

A Dropdown Date picker for Flutter with customizable options.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.2K
Likes
48
Pub points
160

Install package

flutter pub add datepicker_dropdown

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides a dropdown-style date picker with customizable options for selecting dates. It integrates seamlessly into forms and UIs, offering a compact and user-friendly way to pick dates without opening a full calendar modal. Supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The widget is lightweight and designed for developers seeking a simple, accessible alternative to standard date pickers. Customization includes styling, date format, and selection behavior.

Use cases

  • Form inputs requiring date selection
  • Lightweight date input in mobile and web apps
  • Customizable date pickers in constrained UI spaces
  • Integrating date selection into dropdown menus
  • Accessibility-focused date input components

Key features

  • Dropdown-based date selection
  • Cross-platform compatibility
  • Customizable appearance and behavior
  • Supports various date formats
  • Easy integration with existing forms
  • Minimal boilerplate required

Suitable for

  • Developers needing a compact date picker
  • Projects with space constraints on the UI
  • Apps targeting multiple platforms
  • Teams prioritizing accessibility
  • UIs requiring consistent date input design

Considerations

  • Limited to single date selection
  • No built-in validation
  • Requires manual handling of date parsing
  • Not suitable for complex date ranges
  • Less visual feedback compared to full calendar pickers

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Date Picker Dropdown

pub package

A customizable dropdown date picker for Flutter with support for multiple field orders, validation, localization, and form-friendly callbacks.

Web demo: datepicker.robertrobinson.in

Features

  • Day, month, and year dropdowns with configurable order
  • Optional form validation for each field
  • Locale-specific month labels
  • Configurable year range, spacing, flex, styles, and decorations
  • Safe handling of invalid date combinations such as 31 February
  • Controlled-widget support when the parent rebuilds with new selected values

Main View Month View Date View Year View

Getting Started

Add the package to your pubspec.yaml:

dependencies:
  datepicker_dropdown: ^1.0.2

Then run:

flutter pub get

Basic Usage

import 'package:datepicker_dropdown/datepicker_dropdown.dart';
import 'package:datepicker_dropdown/order_format.dart';
import 'package:flutter/material.dart';

class BirthDateField extends StatefulWidget {
  const BirthDateField({super.key});

  @override
  State<BirthDateField> createState() => _BirthDateFieldState();
}

class _BirthDateFieldState extends State<BirthDateField> {
  int? _day;
  int? _month;
  int? _year;

  @override
  Widget build(BuildContext context) {
    return DropdownDatePicker(
      dateFormatOrder: OrderFormat.ydm,
      startYear: 1900,
      endYear: DateTime.now().year,
      selectedDay: _day,
      selectedMonth: _month,
      selectedYear: _year,
      onChangedDay: (String? value) {
        setState(() {
          _day = int.tryParse(value ?? '');
        });
      },
      onChangedMonth: (String? value) {
        setState(() {
          _month = int.tryParse(value ?? '');
        });
      },
      onChangedYear: (String? value) {
        setState(() {
          _year = int.tryParse(value ?? '');
        });
      },
    );
  }
}

Form Example

DropdownDatePicker(
  dateFormatOrder: OrderFormat.mdy,
  isFormValidator: true,
  isDropdownHideUnderline: true,
  startYear: 1900,
  endYear: 2025,
  hintDay: 'Day',
  hintMonth: 'Month',
  hintYear: 'Year',
  inputDecoration: InputDecoration(
    enabledBorder: const OutlineInputBorder(),
    border: OutlineInputBorder(
      borderRadius: BorderRadius.circular(10),
    ),
    contentPadding: const EdgeInsets.symmetric(horizontal: 12),
  ),
  onChangedDay: (String? value) {
    debugPrint('day: $value');
  },
  onChangedMonth: (String? value) {
    debugPrint('month: $value');
  },
  onChangedYear: (String? value) {
    debugPrint('year: $value');
  },
)

Notes

  • dateFormatOrder is the preferred property name.
  • dateformatorder is still supported as a deprecated backwards-compatible alias.
  • If the current day becomes invalid after a month or year change, the widget automatically adjusts it to the last valid day and notifies onChangedDay.
  • The widget syncs correctly when the parent rebuilds with new selectedDay, selectedMonth, or selectedYear values.

Supported Locales

en, en_abbv, num, ar, de_DE, el_GR, es_ES, fr_FR, gu_IN, hi_IN, id_ID, it_IT, ja, kn_IN, ko_KR, ml_IN, mr_IN, nl_NL, pl_PL, pt_BR, ru_RU, sv_SE, ta_IN, te_IN, th, tr, vi, zh_CN

Example App

See the example app in example/lib/main.dart for a complete integration.

Repository

Source code: github.com/Robertrobinson777/dropdown_date_picker

Support

Buy Me A Coffee

Categories

Source repository

Projects using this package

No data available yet.