패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.0+1

adhan

Dart용 아잔 / 무슬림 기도 시간 라이브러리. 이제 Dart에서 기도 시간을 얻는 것이 이전보다 훨씬 쉬워졌습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
195
좋아요
236
Pub 점수
150

패키지 설치

flutter pub add adhan

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

adhan 패키지는 지리적 위치와 날짜를 기반으로 이슬람 예배 시간(아잔)을 계산하기 위해 설계된 Dart 라이브러리입니다. 구성 가능한 계산 방법을 사용하여 정확한 실시간 예배 일정을 제공하며 여러 시간대를 지원합니다. 무슬림 사용자 또는 종교 앱을 개발하는 개발자에게 적합하며, 모바일, 웹, 데스크톱 플랫폼에서 예배 시간 기능 통합을 간소화합니다. 이 라이브러리는 가볍고 잘 문서화되어 있으며 지속적으로 유지보수되고 있습니다.

사용 사례

  • 이슬람 기도 시간 앱
  • 종교 캘린더 통합
  • 일일 알림 시스템
  • 무슬림을 위한 모바일 및 웹 애플리케이션
  • 시간대 인식 스케줄링

주요 기능

  • 정확한 기도 시간 계산
  • 다양한 계산 방법
  • 지리적 위치 기반 타이밍
  • 모든 주요 플랫폼을 지원합니다
  • Flutter와의 간편한 통합
  • 사용자 지정 가능한 기도 간격

적합한 대상

  • 이슬람 앱을 개발하는 개발자
  • 시간 유틸리티가 필요한 Flutter 프로젝트
  • 무슬림 사용자를 대상으로 하는 앱
  • 크로스플랫폼 애플리케이션
  • 정확한 아잔 시간이 필요한 사용자

고려 사항

  • 정확한 위치 정보 입력이 필요합니다
  • 계산 방법이 결과에 영향을 미칩니다
  • 수동으로 시간대를 조정해야 할 수 있습니다
  • 정확성을 위해 외부 데이터 소스에 의존합니다
  • 기도 시간에 한정됨, 전체 이슬람 달력은 아님

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Adhan Dart / Flutter

Pub GitHub Workflow Status codecov GitHub issues Star on GitHub GitHub top language Gitpod ready-to-code License: MIT

Adhan Dart is a well tested and well documented library for calculating Islamic prayer times. Adhan Dart is written to be compatible with Dart and Dart Native / Flutter / Android / iOS / Web etc... devices of all api versions. It has a small method overhead, and has no external dependencies.

All astronomical calculations are high precision equations directly from the book “Astronomical Algorithms” by Jean Meeus. This book is recommended by the Astronomical Applications Department of the U.S. Naval Observatory and the Earth System Research Laboratory of the National Oceanic and Atmospheric Administration.

Implementations of Adhan in other languages can be found in the parent repo Adhan .

Usage

A simple usage example:

import 'package:adhan/adhan.dart';

main() {
  print('My Prayer Times');
  final myCoordinates = Coordinates(23.9088, 89.1220); // Replace with your own location lat, lng.
  final params = CalculationMethod.karachi.getParameters();
  params.madhab = Madhab.hanafi;
  final prayerTimes = PrayerTimes.today(myCoordinates, params);

  print("---Today's Prayer Times in Your Local Timezone(${prayerTimes.fajr.timeZoneName})---");
  print(DateFormat.jm().format(prayerTimes.fajr));
  print(DateFormat.jm().format(prayerTimes.sunrise));
  print(DateFormat.jm().format(prayerTimes.dhuhr));
  print(DateFormat.jm().format(prayerTimes.asr));
  print(DateFormat.jm().format(prayerTimes.maghrib));
  print(DateFormat.jm().format(prayerTimes.isha));

  print('---');

  // Custom Timezone Usage. (Most of you won't need this).
  print('NewYork Prayer Times');
  final newYork = Coordinates(35.7750, -78.6336);
  final nyUtcOffset = Duration(hours: -4);
  final nyDate = DateComponents(2015, 7, 12);
  final nyParams = CalculationMethod.north_america.getParameters();
  nyParams.madhab = Madhab.hanafi;
  final nyPrayerTimes = PrayerTimes(newYork, nyDate, nyParams, utcOffset: nyUtcOffset);

  print(nyPrayerTimes.fajr.timeZoneName);
  print(DateFormat.jm().format(nyPrayerTimes.fajr));
  print(DateFormat.jm().format(nyPrayerTimes.sunrise));
  print(DateFormat.jm().format(nyPrayerTimes.dhuhr));
  print(DateFormat.jm().format(nyPrayerTimes.asr));
  print(DateFormat.jm().format(nyPrayerTimes.maghrib));
  print(DateFormat.jm().format(nyPrayerTimes.isha));
}
See Flutter Example Folder for Flutter Usage Example with Dynamic Location From GPS.

also, you can run pub run adhan to test quickly based on Hanafi, Karachi parameters. *alternatively, without installing in project, you can run pub global activate adhan and then run pub global run adhan to test quickly.

Initialization parameters
Coordinates

Create a Coordinates object with the latitude and longitude for the location you want prayer times for.

final coordinates = new Coordinates(35.78056, -78.6389);

/// Coordinates Validation Support [Optional],
/// to Support validation, use [validate: true] param, default: false

final validateTrue = new Coordinates(91.78056, -78.6389, validate: true); // Invalid Coordinates, will throw ArgumentError

final validateFalse = new Coordinates(91.78056, -78.6389, validate: false); // Invalid Coordinates, won't throw ArgumentError
Date

The date parameter passed in should be an instance of the DateComponents object. The year, month, and day values need to be populated. All other values will be ignored. The year, month and day values should be for the local date that you want prayer times for. These date values are expected to be for the Gregorian calendar. There's also a convenience method for converting a DateTime to DateComponents.

final date = DateComponents(2015, 11, 1);
// or
final date = DateComponents.from(DateTime.now());
Calculation parameters

The rest of the needed information is contained within the CalculationParameters class. Instead of manually initializing this class, it is recommended to use one of the pre-populated instances in the CalculationMethod class. You can then further customize the calculation parameters if needed.

final params = CalculationMethod.muslim_world_league.getParameters();
params.madhab = Madhab.hanafi;
params.adjustments.fajr = 2;
Parameter Description
method CalculationMethod name
fajrAngle Angle of the sun used to calculate Fajr
maghribAngle The angle of the sun used to calculate Maghrib
ishaAngle Angle of the sun used to calculate Isha
ishaInterval Minutes after Maghrib (if set, the time for Isha will be Maghrib plus ishaInterval)
madhab Value from the Madhab object, used to calculate Asr
highLatitudeRule Value from the HighLatitudeRule object, used to set a minimum time for Fajr and a max time for Isha
adjustments PrayerAdjustments object with custom prayer time adjustments in minutes for each prayer time

CalculationMethod

Value Description
muslim_world_league Muslim World League. Fajr angle: 18, Isha angle: 17
egyptian Egyptian General Authority of Survey. Fajr angle: 19.5, Isha angle: 17.5
karachi University of Islamic Sciences, Karachi. Fajr angle: 18, Isha angle: 18
umm_al_qura Umm al-Qura University, Makkah. Fajr angle: 18, Isha interval: 90. Note: you should add a +30 minute custom adjustment for Isha during Ramadan.
dubai Method used in UAE. Fajr and Isha angles of 18.2 degrees.
qatar Modified version of Umm al-Qura used in Qatar. Fajr angle: 18, Isha interval: 90.
kuwait Method used by the country of Kuwait. Fajr angle: 18, Isha angle: 17.5
moonsighting_committee Moonsighting Committee. Fajr angle: 18, Isha angle: 18. Also uses seasonal adjustment values.
singapore Method used by Singapore. Fajr angle: 20, Isha angle: 18.
north_america Referred to as the ISNA method. This method is included for completeness but is not recommended. Fajr angle: 15, Isha angle: 15
turkey Turkey. Fajr angle: 18, Isha angle: 17
tehran Tehran. Fajr angle: 17.7, Isha angle: 14, Maghrib Angle: 4.5
other Fajr angle: 0, Isha angle: 0. This is the default value for method when initializing a CalculationParameters object.

Madhab

Value Description
shafi Earlier Asr time
hanafi Later Asr time

HighLatitudeRule

Value Description
middle_of_the_night Fajr will never be earlier than the middle of the night and Isha will never be later than the middle of the night
seventh_of_the_night Fajr will never be earlier than the beginning of the last seventh of the night and Isha will never be later than the end of the first seventh of the night
twilight_angle Similar to SEVENTH_OF_THE_NIGHT, but instead of 1/7, the fraction of the night used is fajrAngle/60 and ishaAngle/60
Prayer Times

Once the PrayerTimes object has been initialized it will contain values for all five prayer times and the time for sunrise. The prayer times will be DateTime object instances initialized with Local values (converted from UTC via .toLocal method). To display these times for a different timezone than local a UTC Offset should be used, for example Duration.

final kushtiaUtcOffset = Duration(hours: 6);
final newYorkUtcOffset = Duration(hours: -4);
// then pass your offset to PrayerTimes like this:
final prayerTimes = PrayerTimes(coordinates, date, params, utcOffset: newYorkUtcOffset);

Methods

name return
timeForPrayer DateTime instance
currentPrayer Prayer enum instance
currentPrayerByDateTime Prayer enum instance
nextPrayer Prayer enum instance
nextPrayerByDateTime Prayer enum instance
Sunnah Times
final prayerTimes = PrayerTimes(coordinates, date, params, utcOffset: newYorkUtcOffset);
final sunnahTimes = SunnahTimes(prayerTimes);
// and then access
/// The midpoint between Maghrib and Fajr
sunnahTimes.middleOfTheNight
/// The beginning of the last third of the period between Maghrib and Fajr,
/// a recommended time to perform Qiyam
sunnahTimes.lastThirdOfTheNight
Qibla
final qibla = Qibla(coordinates);
/// Qibla direction degree (Compass/Clockwise)
qibla.direction

Features and bugs

Please file feature requests and bugs at the issue tracker.

Inspired / Adopted From

Adhan Java

Adhan Java is a well tested and well documented library for calculating Islamic prayer times. Adhan Java is written to be compatible with Java and Android devices of all api versions. It compiles against Java 7 to ensure compatibility with Android. It has a small method overhead, and has no external dependencies.

All astronomical calculations are high precision equations directly from the book “Astronomical Algorithms” by Jean Meeus. This book is recommended by the Astronomical Applications Department of the U.S. Naval Observatory and the Earth System Research Laboratory of the National Oceanic and Atmospheric Administration.

Implementations of Adhan in other languages can be found in the Adhan repo.

Alt

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.