bluefireteam/daylight
API에 접근하지 않고도 지리 위치의 일출 및 일몰 시간을 얻으세요.
- Stars
- 64
- Forks
- 13
- 최근 푸시(UTC)
- 2026. 2. 17.
- 프로젝트 상태
- 활성
언어Dart
사용 중인 의존성
의존성 목록 5 개
- equatable
^2.0.5 - intl개발 의존성
>=0.19.0 <0.21.0 - mocktail개발 의존성
^1.0.0 - test개발 의존성
^1.19.2 - very_good_analysis개발 의존성
>=5.1.0 <8.0.0
원본 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()));