FLUTTER ECOSYSTEM

bluefireteam/daylight

किसी भी API के माध्यम से प्राप्त करने के बिना एक भौगोलिक स्थिति के लिए सूर्योदय और सूर्यास्त के समय प्राप्त करें।

दिन का प्रकाश प्रोजेक्ट कवर
Stars
64
Forks
13
अंतिम पुश (UTC)
17 फ़र॰ 2026
प्रोजेक्ट स्थिति
सक्रिय
Blue Fire GitHub avatar
GITHUB Organization

Blue Fire ↗

Team working on open source packages and plugins for Flutter, including Flame, Audioplayers, Photo View, and more.

भाषाएँDart

उपयोग की गई निर्भरताएँ

निर्भरता सूची 5 आइटम

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

README खोलें / बंद करें

Daylight

Pub style: very good analysis License: MIT

Get the sunset and sunrise times for a geolocation without having to access any remote api.

This is a simple implementation of the legendary Sunset/Sunrise algorithm.

Installation 💻

❗ In order to start using Daylight you must have the Dart SDK installed on your machine.

Install it:

dart pub add daylight

Usage 📖

Check the API docs, example and tests for more information about how to use it.

import 'package:daylight/daylight.dart';


final berlin = DaylightLocation(52.518611, 13.408056);
final berlinCalculator = DaylightCalculator(berlin);
final dailyResults = berlinCalculator.calculateForDay(DateTime.now(), Zenith.astronomical);
print(dailyResults.sunrise); // Some UTC datetime with sunrise hours like 08:32
print(dailyResults.sunset);
print(dailyResults.type); // day type, will probably be sunriseAndSunset unless you live near the north pole or south pole


double eventHourEpoch = berlinCalculator.calculateEvent(DateTime.now(), Zenith.official, EventType.sunset);
print(DateTime.fromMillisecondsSinceEpoch(eventHourEpoch.floor()));