惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
L
LangChain Blog
美团技术团队
N
Netflix TechBlog - Medium
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
博客园 - 司徒正美
爱范儿
爱范儿
D
DataBreaches.Net
月光博客
月光博客
U
Unit 42
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
MongoDB | Blog
MongoDB | Blog
腾讯CDC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Islamic Hijri Calendar Package
Codexlancers · 2026-04-28 · via DEV Community

Codexlancers


Introduction
Introducing our Islamic Hijri Calendar Package for displaying most fully featured dates in Arabic and English numerals. In this solution, customers can easily notice the month’s name in Hijri, with a year and move months without any hassle. Today, I am going to introduce the Islamic Hijri

Calendar Package, which is a versatile, easy-to-use Flutter package that has the ability to show both the Islamic Hijri and the Gregorian Calendars in your Flutter apps.

Key Features
Dual Calendar View: Toggle between the Hijri and Gregorian calendars effortlessly.
Customizable Appearance: Adjust the 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

Enter fullscreen mode Exit fullscreen mode

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,
          ),
        ),
      ),
    );
  }
}

Enter fullscreen mode Exit fullscreen mode

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

Enter fullscreen mode Exit fullscreen mode

Appearance Customization:
Customize the appearance of the calendar using the following properties:


highlightBorder: Sets the border color for the selected date.
defaultBorder: Sets the border color for other dates.
highlightTextColor: Sets the text color for today’s date.
defaultTextColor: Sets the text color for other dates.
defaultBackColor: Sets the 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,

Enter fullscreen mode Exit fullscreen mode

Google Fonts:
Use Google Fonts to enhance the appearance of your calendar:

isGoogleFont: true,
fontFamilyName: "Lato",

Enter fullscreen mode Exit fullscreen mode

Date Selection Callbacks:
Capture the selected date in both Gregorian and Hijri formats using these callbacks:

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

Enter fullscreen mode Exit fullscreen mode

Date Adjustment:
Adjust the Hijri calendar dates by a specific value:

adjustmentValue: 0, // No adjustmen

Enter fullscreen mode Exit fullscreen mode

Disable Previous/Next Month Dates:
Decide whether to show or hide dates from previous or next months:

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

Enter fullscreen mode Exit fullscreen mode

Conclusion:
There is a calendar widget for Muslim users available for Flutter apps. This widget shows dates according to the Islamic Hijri Calendar with the familiar Gregorian calendar. This widget is pretty easy to set up in your app and has some appearance customization. It will help any Flutter app that is specifically targeted to engage Muslim users. For more information, you can check it out at Pub.dev

more information, check out the

https://pub.dev/packages/islamic_hijri_calendar


Thanks for reading! If you found this post useful, please share it with others in your network and follow me for more Flutter insights and tutorials. Keep coding and stay awesome!