Hijri (Umm al-Qura / Islamic calendar) date picker for Flutter.
Overview
Since v5.0.0, this package is a thin adapter that lets Flutter's built-in
Material 3 date picker render Hijri dates. It implements the
CalendarDelegate
API introduced in Flutter 3.32, so you get Flutter's showDatePicker,
CalendarDatePicker, DatePickerDialog, InputDatePickerFormField, and
YearPicker for free — with Hijri month names, Hijri weekday offsets,
Hijri month lengths, and full theming via DatePickerThemeData.
2. Home — bottom: InputDatePickerFormField, the embedded 3-column YearPicker (1447 selected), and the theming legend card.
3.showHijriDatePicker — basic dialog. Header reads "Fri, 5 DhuH"; M3 mode-toggle pencil icon in the corner.
4. Full options: custom helpText: "SELECT HIJRI DATE", uppercase cancelText/confirmText, and a selectableDayPredicate that disables Fridays (note the circled-disabled Friday 5).
5. Input mode (the pencil icon toggles to text-input). Typing 12/5/1447 in the locale's compact format — accepted by HijriCalendarDelegate.parseCompactDate.
Dark theme — Colors.blue seed
6. Same home in dark mode — Material 3 picks up the blue seed for primary/selection colors via ColorScheme.fromSeed.
7. Dark home, scrolled: input field, year grid (1447 highlighted in blue), and the dark theming legend.
8. Basic showHijriDatePicker dialog in dark mode — Hijri month name in the header, blue selection chip on day 5.
9. Full-options dialog in dark mode — Fridays disabled by predicate, day 6 (Saturday) selected.
10.DatePickerEntryMode.inputOnly — opens straight into a compact text field, no calendar.
11. Dark home scrolled — Hijri year grid 1439–1450 with 1447 selected (out-of-range years 1439–1441 dimmed).
Arabic locale (RTL)
12. Locale switched to ar_SA via the AppBar toggle. Layout flipped to RTL; calendar uses Arabic weekday abbreviations and Eastern-Arabic digits.
13.showHijriDatePicker dialog in Arabic. The cancelText/confirmText are still the English overrides we passed (demonstrating they take precedence over MaterialLocalizations).
14. Arabic input mode — compact-date field typed as 1447/12/5.
15. Embedded CalendarDatePicker + InputDatePickerFormField in Arabic — same widgets, RTL layout, Arabic month name.
16. Embedded YearPicker in Arabic — 3-column M3 year grid (1441–1450), 1447 selected.
Quick start
Register the standard Material/Widgets localization delegates:
Note on YearPicker: Flutter's YearPicker constructor defaults
currentDate to DateTime.now() (plain Gregorian) rather than
calendarDelegate.now(), which crashes with any non-Gregorian delegate.
Workaround: always pass currentDate: HijriDateTime.now() explicitly.
The other entry points (CalendarDatePicker, DatePickerDialog,
showDatePicker) handle this correctly.