luz do dia
Obtenha os horários de nascer e pôr do sol para uma localização geográfica sem precisar acessar qualquer API.
- Estrelas
- 64
- Forks
- 13
- Último push (UTC)
- 17 de fev. de 2026
- Status do projeto
- Ativo
README original
Texto original em inglês. Visite o GitHub para a versão atual.
Daylight
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()));
LinguagensDart
Dependências usadas
Lista de dependências 5 itens
- equatable
^2.0.5 - intlDesenvolvimento
>=0.19.0 <0.21.0 - mocktailDesenvolvimento
^1.0.0 - testDesenvolvimento
^1.19.2 - very_good_analysisDesenvolvimento
>=5.1.0 <8.0.0
Como escolher um repositório para seu projeto?
Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.
- Busque por nome, autor ou descrição e filtre por tema.
- Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
- Confira o README, a licença e as issues no GitHub antes de usar o projeto.
Fontes e manutenção
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗