adhan 1.1.8 copy "adhan: ^1.1.8" to clipboard
adhan: ^1.1.8 copied to clipboard

outdated

Adhan for Dart / Muslim Prayer Times Library. Now retrieving Prayer time in Dart easier than ever.

example/adhan_example.dart

import 'package:adhan/adhan.dart';
import 'package:intl/intl.dart';

void main() {
  print('Kushtia 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(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));
}
214
likes
0
pub points
94%
popularity

Publisher

verified publisherriajul.dev

Adhan for Dart / Muslim Prayer Times Library. Now retrieving Prayer time in Dart easier than ever.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on adhan