material_drum_picker 1.5.0 copy "material_drum_picker: ^1.5.0" to clipboard
material_drum_picker: ^1.5.0 copied to clipboard

A Material 3 date picker with an iOS-style drum roller, full API parity with showDatePicker and CupertinoDatePicker, and drum, calendar and input modes.

Changelog #

1.5.0 #

  • Month as a name or a number. New monthFormat parameter (DrumMonthFormat.name or .numeric) switches the drum month column between the abbreviated month name (the default) and a zero padded number. It works with every calendar system and locale, since a numeric month is just the month index in the locale's digits.
  • Configurable typed date format. New inputFormat parameter takes a DrumDateFormat that controls the keyboard input mode: the order of the day, month, and year fields, the separator, and whether the year is two or four digits. Build one from a pattern with DrumDateFormat.parse('DD-MM-YYYY'), or use a preset (DrumDateFormat.mdy, .dmy, .ymd). The format drives the field's value, hint, and parsing in whatever calendar the picker is using, and a two digit year is resolved into the supported range at the year nearest the current selection.
  • Both additions default to the previous behavior (month names and MM/DD/YYYY) and are available on DrumPicker, showDrumDatePicker, and showDrumDateTimePicker. Existing output is unchanged.

1.4.0 #

  • Deep visual theming. DrumPickerTheme gains a much larger token set: typography (headlineTextStyle, helpTextStyle, secondaryTextStyle, columnLabelTextStyle, selectedItemTextStyle, unselectedItemTextStyle), the calendar grid colors that were previously hard coded (dayForegroundColor, selectedDayBackgroundColor, selectedDayForegroundColor, todayColor, disabledDayColor), and shape and spacing (dayShape, selectorBandRadius, headerPadding). Text style tokens merge over the defaults, so you can change one field (for example the weight) without losing the themed color.
  • Per-instance theming. DrumPicker, DrumTimePicker, and the showDrum*Picker functions take a new theme parameter. It is merged over any ambient DrumPickerTheme extension, so you can style a single picker without touching the app theme. The calendar grid now honors the theme tokens too (previously it always used the raw ColorScheme).
  • Overridable labels. New DrumPickerLabels lets you translate or relabel the fixed UI strings that were not otherwise localized: the drum column headers (DAY, MONTH, YEAR), the time strip headers (HOUR, MIN, AM/PM), the mode toggle (Calendar, Drum, Input), and the default quick select chips.
  • Custom input decoration. A new inputDecoration parameter lets the input mode field inherit your app's InputDecorationTheme or a custom decoration.
  • Fully backward compatible: every new token and parameter defaults to the previous appearance and behavior, so existing output is unchanged.

1.3.0 #

  • Hijri (Umm al-Qura) calendar. Pass calendar: DrumCalendarType.hijri to show the drum, calendar, and input modes in the lunar Hijri calendar, fully composed with the existing right to left support. The returned value is still a Gregorian DateTime. The Umm al-Qura table is vendored as pure Dart, so the package keeps its only runtime dependencies as Flutter and intl.
  • Pluggable data backed calendars. New TabularLunarCalendarSystem lets you drive the picker from a published dataset of Hijri month start dates (for an official or committee lunar calendar). Pass an instance through the new calendarSystem parameter, which takes precedence over calendar. The package ships only the mechanism and a documented schema, never any specific publisher's data. Malformed datasets are rejected rather than producing wrong dates.
  • New public types: DrumCalendarType, DrumCalendarSystem, GregorianCalendarSystem, HijriCalendarSystem, TabularLunarCalendarSystem, TabularLunarMonth, and CalendarDate.
  • New showGregorianAlongside flag (off by default) renders the Gregorian equivalent as a small secondary line in the header.
  • Day, month, and year numbers now route through one locale aware numeral path, so a locale that uses Arabic-Indic digits renders them consistently across the drum, calendar, input, and header.
  • No breaking changes. Every new parameter defaults to the previous Gregorian behavior, and all existing tests and goldens pass unchanged.

1.2.0 #

  • Time-only picking. New DrumTimePicker widget and showDrumTimePicker function that return a TimeOfDay. Configurable for AM/PM (12 hour) or 24 hour mode via use24hFormat (which falls back to MediaQuery.alwaysUse24HourFormat), with minuteInterval granularity.
  • Example app gains a "Time only" screen (12 hour dialog, 24 hour dialog with 5 minute steps, and an inline 15 minute picker).
  • README rewritten and expanded: a pickers overview table plus dedicated date+time and time-only screenshots.

1.1.0 #

  • Date + time picking. DrumPicker gains pickTime, use24hFormat, and minuteInterval. When pickTime is true, a compact time drum strip (hour, minute, and AM/PM in 12-hour mode) appears below the date selector and the confirmed value includes the chosen time.
  • New showDrumDateTimePicker convenience function, the same API as showDrumDatePicker but returns a DateTime that carries the time.
  • use24hFormat falls back to MediaQuery.alwaysUse24HourFormat; AM/PM labels and the header time are localized. minuteInterval snaps the initial minute and is asserted to divide 60.

1.0.0 #

Initial release.

  • showDrumDatePicker, a drop-in replacement for Flutter's showDatePicker with full parameter parity (firstDate, lastDate, initialDate, currentDate, selectableDayPredicate, helpText, confirmText, cancelText, errorFormatText, errorInvalidText, fieldHintText, fieldLabelText, locale, textDirection, barrierDismissible, barrierColor, barrierLabel, useRootNavigator, routeSettings, restorationId, anchorPoint, builder).
  • DrumPicker inline widget for embedding in forms (no dialog).
  • Three context-aware input modes: drum, calendar, and input, with a mode toggle.
  • selectableDayPredicate enforced in all three modes, including nearest-valid-date snapping in drum mode.
  • Quick-select chips with quickSelectOptions and DrumQuickSelect.relative.
  • Configurable columnOrder (dmy / mdy / ymd / ydm) with locale-aware defaults, plus showDayOfWeekInDrum.
  • DrumPickerTheme extension for Material 3 token overrides.
  • Full RTL and localization support via intl and flutter_localizations.
  • showDrumDateRangePicker API stub (throws UnimplementedError; full implementation planned for 1.1.0).
1
likes
160
points
118
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Material 3 date picker with an iOS-style drum roller, full API parity with showDatePicker and CupertinoDatePicker, and drum, calendar and input modes.

Repository (GitHub)
View/report issues
Contributing

Topics

#date-picker #material #material-3 #ui #widget

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on material_drum_picker