salat 1.0.4 copy "salat: ^1.0.4" to clipboard
salat: ^1.0.4 copied to clipboard

a dart package that calculates salat times

example/salat_example.dart

import 'package:salat/salat.dart';
import 'package:timezone/standalone.dart' as tz;

void main(List<String> args) async {
  await tz.initializeTimeZone();

  String timezone = "Asia/Riyadh"; // Time zone of Mecca (Riyadh)
  final pt = prayerTimes(
      method: CalculationMethod.MAKKAH); // Create prayer times object

  double longitude = 39.857910; // Longitude of the location
  double latitude = 21.389082; // Latitude of the location

  // Calculate prayer times for the given location
  final prayertimes = pt.calcTime(
    date: DateTime.now(),
    timezone: timezone,
    longitude: longitude,
    latitude: latitude,
  );
  printPrayerTimes(prayertimes);
}
5
likes
120
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

a dart package that calculates salat times

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

hijri, intl, tabular, timezone

More

Packages that depend on salat