flutterJuly 19, 2024

Islamic Hijri Calendar Package

Introduction

Introducing our Islamic Hijri Calendar package the most fully featured solution for displaying dates in both Arabic and English numerals. Customers can easily navigate months, view the Hijri month name, and move between months without any hassle.

The Islamic Hijri Calendar package is a versatile, easy-to-use Flutter package with the ability to show both the Islamic Hijri and the Gregorian Calendars in your Flutter apps all from a single widget.

Key Features

  • Dual Calendar View : Toggle between the Hijri and Gregorian calendars effortlessly.
  • Customizable Appearance : Adjust border colors, text colors, background colors, and font styles to match your app’s theme.
  • Google Fonts Support : Use Google Fonts to ensure your calendar looks modern and clean.
  • Date Selection Callbacks : Get the selected date in both Gregorian and Hijri formats.
  • Date Adjustment : Adjust the Hijri calendar by a certain number of days as needed.
  • Disable Out-of-Month Dates : Show or hide dates that are not part of the current month.

Installation

First, add the package to your pubspec.yaml:

dependencies:
  islamic_hijri_calendar: ^1.0.0

Usage

Here’s how you can integrate the Islamic Hijri Calendar package into your Flutter app:

import 'package:flutter/material.dart';
import 'package:islamic_hijri_calendar/islamic_hijri_calendar.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSwatch().copyWith(
          primary: Colors.blue,
          onBackground: Colors.black,
          background: Colors.white,
        ),
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Islamic Hijri Calendar'),
        ),
        body: Center(
          child: IslamicHijriCalendar(
            isHijriView: true,
            highlightBorder: Theme.of(context).colorScheme.primary,
            defaultBorder: Theme.of(context).colorScheme.onBackground.withOpacity(.1),
            highlightTextColor: Theme.of(context).colorScheme.background,
            defaultTextColor: Theme.of(context).colorScheme.onBackground,
            defaultBackColor: Theme.of(context).colorScheme.background,
            adjustmentValue: 0,
            isGoogleFont: true,
            fontFamilyName: "Lato",
            getSelectedEnglishDate: (selectedDate) {
              print("English Date : $selectedDate");
            },
            getSelectedHijriDate: (selectedDate) {
              print("Hijri Date : $selectedDate");
            },
            isDisablePreviousNextMonthDates: true,
          ),
        ),
      ),
    );
  }
}

Customization Options

Dual Calendar View

The isHijriView property allows users to toggle between viewing the Hijri calendar and the Gregorian calendar.

isHijriView: true, // Show Hijri calendar

Appearance Customization

Customize the calendar’s look using the following properties:

  • highlightBorder : Border color for the selected date.
  • defaultBorder : Border color for other dates.
  • highlightTextColor : Text color for today’s date.
  • defaultTextColor : Text color for other dates.
  • defaultBackColor : Background color for dates.
highlightBorder: Theme.of(context).colorScheme.primary,
defaultBorder: Theme.of(context).colorScheme.onBackground.withOpacity(.1),
highlightTextColor: Theme.of(context).colorScheme.background,
defaultTextColor: Theme.of(context).colorScheme.onBackground,
defaultBackColor: Theme.of(context).colorScheme.background,

Google Fonts

Enhance the calendar’s typography using any Google Font:

isGoogleFont: true,
fontFamilyName: "Lato",

Date Selection Callbacks

Capture the selected date in both Gregorian and Hijri formats:

getSelectedEnglishDate: (selectedDate) {
  print("English Date : $selectedDate");
},
getSelectedHijriDate: (selectedDate) {
  print("Hijri Date : $selectedDate");
},

Date Adjustment

Adjust the Hijri calendar dates by a specific value to align with your region’s moon sighting:

adjustmentValue: 0, // No adjustment

Disable Previous/Next Month Dates

Choose whether to show or hide overflow dates from adjacent months:

isDisablePreviousNextMonthDates: true, // Disable dates not in the current month

Screenshots

Hijri Calendar View
Hijri Calendar View
Gregorian Calendar View
Gregorian Calendar View
Dark Mode Calendar
Dark Mode View

Conclusion

The Islamic Hijri Calendar widget is the go-to solution for Flutter developers building apps for Muslim users. It beautifully displays dates according to the Islamic Hijri system alongside the familiar Gregorian calendar with minimal setup and extensive appearance customization. Whether you’re building a prayer time app, Ramadan tracker, or any Islamic lifestyle tool, this widget is an essential addition to your stack.

For more information and full documentation, check it out on pub.dev.

Keep Reading
Related Articles

You Might Also Like

Is Flutter Good for Business Apps? Pros, Cons and When Not to Use It

Is Flutter Good for Business Apps? Pros, Cons and When Not to Use It

Flutter can cut development cost and speed up launch, but it isn’t right for every business app. Here are the real pros, cons, and the cases where you should skip it.

flutter+3
Nov 2, 2026Read more
FlutterFlow App Events: Complete Guide for Scalable App Development

FlutterFlow App Events: Complete Guide for Scalable App Development

Introduction Building scalable applications in low-code platforms has always been a balance between speed and maintainability. While FlutterFlow makes UI development incredibly fast, managing communication between different parts of an app could sometimes become complex. With the introduction of App Events, FlutterFlow has taken a major step forward bringing cleaner architecture, better performance, and a […]

flutter
Apr 21, 2026Read more
Integrating Tamara Payment Gateway in a FlutterFlow Application

Integrating Tamara Payment Gateway in a FlutterFlow Application

Introduction Integrating a reliable payment gateway is essential for delivering a smooth and secure user experience. Building a payment system isn’t just about processing transactions it’s about ensuring security, reliability, and compliance, all while maintaining a seamless user journey. Here’s how I integrated the Tamara Payment Gateway into a FlutterFlow application, creating a complete end-to-end […]

flutter
Apr 21, 2026Read more
How I Built a Production-Ready AI Chat App in FlutterFlow (With OpenAI + Firebase)

How I Built a Production-Ready AI Chat App in FlutterFlow (With OpenAI + Firebase)

Introduction AI is everywhere in 2026 but building a production-ready AI chat app is still challenging, especially when using low-code tools like FlutterFlow. In this article, I’ll walk you through how I built a scalable AI chat system using FlutterFlow + Firebase + OpenAI API. Architecture Overview Frontend : FlutterFlow UI Backend : Firebase (Firestore […]

flutter
Apr 20, 2026Read more