calendar_picker_ghe 2.2.0 copy "calendar_picker_ghe: ^2.2.0" to clipboard
calendar_picker_ghe: ^2.2.0 copied to clipboard

A lightweight Gregorian, Hijri, and Ethiopian Calendar date picker which is simple to use with a unified system.

calendar_picker_ghe #

A lightweight, customizable Flutter date picker supporting:

  • πŸ—“οΈ Gregorian Calendar
  • πŸ•Œ Hijri 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, and initialYear
  • 🌐 Multilingual support: English (default), Amharic, Arabic
  • 🎯 Unified function: showUnifiedDatePicker(...)
  • 🌍 Clean, extensible codebase for integrating other calendars
  • πŸ“± Responsive for small and large screens

πŸ“Έ Screenshots #

πŸ‡¬πŸ‡§ English #

Gregorian Ethiopian Hijri
Gregorian English Ethiopian English Hijri English

πŸ‡ͺπŸ‡Ή Amharic #

Gregorian Ethiopian Hijri
Gregorian Amharic Ethiopian Amharic Hijri Amharic

πŸ‡ΈπŸ‡¦ Arabic #

Gregorian Ethiopian Hijri
Gregorian Arabic Ethiopian Arabic Hijri Arabic

πŸš€ Getting Started #

πŸ“¦ Installation #

Run this command in your Flutter terminal:

flutter pub add calendar_picker_ghe

This will add the following line to your pubspec.yaml and fetch the package:

dependencies:
calendar_picker_ghe: ^2.2.0

πŸ“₯ Import the Package #

import 'package:calendar_picker_ghe/calendar_picker.dart';

πŸ§ͺ Usage #

 
final pickedDate = await showUnifiedDatePicker(
context: context,
calendarType: CalendarType.ethiopian, // or .hijri / .gregorian
initialYear: 2015,
firstYear: 2000,
lastYear: 2030,
);

🧭 Full Function Signature #

Future<dynamic> showUnifiedDatePicker({
  required BuildContext context,
  required CalendarType calendarType,
  required int initialYear,
  required int firstYear,
  required int lastYear,
  String locale = 'en', // Optional: 'en', 'am', or 'ar'
});

πŸ“˜ Field Descriptions #

Parameter Type Required Default Description
context BuildContext βœ… Yes – The build context from which the date picker will be shown.
calendarType CalendarType βœ… Yes – The calendar system to use: gregorian, ethiopian, or hijri.
initialYear int βœ… Yes – The year that will be initially displayed when the picker opens.
firstYear int βœ… Yes – The earliest year a user can navigate to and select.
lastYear int βœ… Yes – The latest year a user can navigate to and select.
locale String ❌ No 'en' Language: 'en' (English), 'am' (Amharic), or 'ar' (Arabic)

🌐 Locale Options #

By default, the date picker uses English. Use the locale parameter to switch language:

Locale Language
'en' English (default)
'am' Amharic
'ar' Arabic

βœ… Usage Examples (All 9 Possibilities) #

// Gregorian - English (default)
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.gregorian,
  initialYear: DateTime.now().year,
  firstYear: 1900,
  lastYear: 2100,
);

// Gregorian - Amharic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.gregorian,
  initialYear: DateTime.now().year,
  firstYear: 1900,
  lastYear: 2100,
  locale: 'am',
);

// Gregorian - Arabic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.gregorian,
  initialYear: DateTime.now().year,
  firstYear: 1900,
  lastYear: 2100,
  locale: 'ar',
);

// Ethiopian - English
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.ethiopian,
  initialYear: Ethiopian.now().year,
  firstYear: 1900,
  lastYear: 2100,
);

// Ethiopian - Amharic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.ethiopian,
  initialYear: Ethiopian.now().year,
  firstYear: 1900,
  lastYear: 2100,
  locale: 'am',
);

// Ethiopian - Arabic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.ethiopian,
  initialYear: Ethiopian.now().year,
  firstYear: 1900,
  lastYear: 2100,
  locale: 'ar',
);

// Hijri - English
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.hijri,
  initialYear: Hijri.now().year,
  firstYear: 1358,
  lastYear: 1500,
);

// Hijri - Amharic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.hijri,
  initialYear: Hijri.now().year,
  firstYear: 1358,
  lastYear: 1500,
  locale: 'am',
);

// Hijri - Arabic
await showUnifiedDatePicker(
  context: context,
  calendarType: CalendarType.hijri,
  initialYear: Hijri.now().year,
  firstYear: 1358,
  lastYear: 1500,
  locale: 'ar',
);

πŸ“˜ Notes #

To set the initial year dynamically:


initialYear: DateTime.now().year, // Gregorian
initialYear: Hijri.now().year,    // Hijri (requires Hijri converter)
initialYear: Ethiopian.now().year, // Ethiopian (requires Ethiopian converter)

πŸ“ License #

This project is licensed under the terms of the Apache License 2.0.

πŸ“¬ Contact #

For questions, feedback, or contributions:

πŸ“§ Email: halidawell00@gmail.com

2
likes
160
points
457
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight Gregorian, Hijri, and Ethiopian Calendar date picker which is simple to use with a unified system.

Repository (GitHub)
View/report issues

Topics

#calendar-converter #gregorian-date-picker #hijri-date-picker #ethiopian-date-picker #localization

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ethiopian_datetime, flutter, hijri

More

Packages that depend on calendar_picker_ghe