calendar_picker_ghe
A lightweight, customizable Flutter date picker supporting:
- ποΈ Gregorian Calendar
- π Hijri (Islamic) Calendar
- πΏ Ethiopian Calendar
Easily switch between calendars using a unified API with a clean, customizable dialog interface.
β¨ Features
- π Easy month/year navigation via dropdowns and arrows
- β Highlights for todayβs date and selected date
- π Configurable year range:
firstYear,lastYear, andinitialYear - π― Unified function:
showUnifiedDatePicker(...) - π Clean, extensible codebase for integrating other calendars
- Responsive for small devices
πΈ Screenshots
π Gregorian Calendar
| On Small Screen | On Big Screen |
|---|---|
πΏ Ethiopian Calendar
| On Small Screen | On Big Screen |
|---|---|
π Hijri Calendar
| On Small Screen | On Big Screen |
|---|---|
π Getting Started
π¦ Installation
Run this command in your Flutter terminal:
flutter pub add calendar_picker_ghe
π₯ Import the Package
In your Dart file:
import 'package:calendar_picker_ghe/calendar_picker.dart';
π§ͺ Usage
import 'package:calendar_picker_ghe/calendar_picker.dart';
final pickedDate = await showUnifiedDatePicker(
context: context,
calendarType: CalendarType.ethiopian, // or CalendarType.hijri / .gregorian
initialYear: 2015,
firstYear: 2000,
lastYear: 2030,
);
The calendarType can be one of: CalendarType.gregorian, CalendarType.hijri, or CalendarType.ethiopian.
initialYear, firstYear, and lastYear define the visible year range and default year in the dropdown.
To set the initialYear to todayβs year:
initialYear: DateTime.now().year, // Gregorian calendar
For Hijri and Ethiopian calendars, use:
initialYear: Hijri.now().year, // Hijri calendar
initialYear: Ethiopian.now().year, // Ethiopian calendar
(Requires appropriate date converter utilities from calendar_converter.dart)
π License
This project is licensed under the terms of the Apache License 2.0.
π¬ Contact
For questions, feedback, or contributions: