flutter_suncalc 0.1.0 copy "flutter_suncalc: ^0.1.0" to clipboard
flutter_suncalc: ^0.1.0 copied to clipboard

A port of the suncalc library from https://github.com/mourner/suncalc

flutter_suncalc #

A port of the suncalc library from https://github.com/mourner/suncalc

This code is based on the original Javascript suncalc by Vladimir Agafonkin ("mourner").

Usage Example #

import 'package:flutter_suncalc/flutter_suncalc.dart';

var date = new DateTime();

// get today's sunlight times for London
var times = SunCalc.getTimes(date, 51.5, -0.1);

// format sunrise time from the Date object
var sunriseStr = times["sunrise"].toLocal();

// get position of the sun (azimuth and altitude) at today's sunrise
var sunrisePos = SunCalc.getPosition(times["sunrise"], 51.5, -0.1);

// get sunrise azimuth in degrees
var sunriseAzimuth = sunrisePos["azimuth"] * 180 / PI;
0
likes
30
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A port of the suncalc library from https://github.com/mourner/suncalc

Homepage

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_suncalc