hebrew_date_picker 0.1.1
hebrew_date_picker: ^0.1.1 copied to clipboard
A Material-style date picker that shows the Hebrew (Jewish) date in every day cell, the Hebrew months in the month title and the full Hebrew date of the selected day.
hebrew_date_picker #
A Material-style Flutter date picker that shows the Hebrew (Jewish) date alongside the Gregorian one:
- every day cell shows the Gregorian day and the Hebrew day in letters (e.g.
12/א׳), - the month title shows the Gregorian month and the Hebrew months it covers
(e.g.
September 2026/אלול–תשרי תשפ״ז), - the header shows the full Hebrew date of the selected day (e.g.
א׳ תשרי תשפ״ז), - tapping the month title opens a year grid with the Gregorian and the Hebrew years
(e.g.
1990/תש״נ–תשנ״א), so far-away dates are a couple of taps away.
Hebrew dates are calculated with kosher_dart and the calendar grid is built on table_calendar.
Installation #
dependencies:
hebrew_date_picker: ^0.1.1
Usage #
As a dialog #
import 'package:hebrew_date_picker/hebrew_date_picker.dart';
final DateTime? date = await showHebrewDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2020),
lastDate: DateTime(2030),
);
The future completes with the selected date (time stripped), or null if the picker was
canceled or dismissed.
As an embedded widget #
HebrewDatePicker(
initialDate: DateTime.now(),
firstDate: DateTime(2020),
lastDate: DateTime(2030),
onConfirm: (date) => print(date),
onCancel: () => print('canceled'),
onDateChanged: (date) => print('tapped $date'),
)
Customization #
| Parameter | Default |
|---|---|
dayMode |
DayMode.both |
initialDatePickerMode |
DatePickerMode.day |
primaryColor |
ColorScheme.primary |
secondaryTextColor |
ColorScheme.onSurfaceVariant |
helpText |
MaterialLocalizations.datePickerHelpText |
cancelText |
MaterialLocalizations.cancelButtonLabel |
confirmText |
MaterialLocalizations.okButtonLabel |
locale |
the intl default locale |
dayMode controls what each day cell shows:
DayMode |
Day cell |
|---|---|
both |
the Gregorian day with the Hebrew day below it (12 / א׳) |
hebrew |
only the Hebrew day (א׳) |
gregorian |
only the Gregorian day (12) |
showHebrewDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2020),
lastDate: DateTime(2030),
dayMode: DayMode.hebrew,
);
initialDatePickerMode: DatePickerMode.year opens the picker on the year grid, which suits
dates far from today such as a birth date:
showHebrewDatePicker(
context: context,
initialDate: DateTime(1990, 1, 1),
firstDate: DateTime(1900),
lastDate: DateTime.now(),
initialDatePickerMode: DatePickerMode.year,
);
locale controls the Gregorian month title and the weekday names. For a locale other than
en_US, initialize the date formatting data first, e.g. by adding flutter_localizations to
your app or calling initializeDateFormatting() from package:intl/date_symbol_data_local.dart.
Hebrew date helpers #
The DateTime extension used by the picker is exported as well:
DateTime(2026, 9, 12).getHebrewDateFormatted(); // א׳ תשרי תשפ״ז
DateTime(2026, 9, 12).getHebrewDayOfMonth(); // א׳
DateTime(2026, 9, 1).getHebrewMonthsOfMonth(); // אלול–תשרי תשפ״ז
DateTime(1990).getHebrewYearsOfYear(); // תש״נ–תשנ״א
Example #
See the example app.