yeradis / haversine.dart Goto Github PK
View Code? Open in Web Editor NEWCalculating geographic distances using the Haversine formula in Dart
License: MIT License
Calculating geographic distances using the Haversine formula in Dart
License: MIT License
Apparently Dart has renamed the PI
constant in 'dart:math', it is now named pi
.
See: https://api.dart.dev/stable/2.4.0/dart-math/pi-constant.html
When using haversine package I am getting this error:
Compiler message:
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/haversine-1.0.2/lib/src/haversine_base.dart:72:68: Error: Getter not found: 'PI'.
double _radiansFromDegrees(final double degrees) => degrees * (PI / 180.0);
^^
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/haversine-1.0.2/lib/src/haversine_base.dart:72:68: Error: The getter 'PI' isn't defined for the class 'Haversine'.
- 'Haversine' is from 'package:haversine/src/haversine_base.dart' ('file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/haversine-1.0.2/lib/src/haversine_base.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'PI'.
double _radiansFromDegrees(final double degrees) => degrees * (PI / 180.0);
^^
Hi,
I discovered this package through pub.dev: https://pub.dev/packages/haversine
Unfortunately for whatever reason the source GitHub repo (this one) is not linked in the sidebar, it usually is for all other packages. It may have to do with how relatively early this package was published.
I like visiting the package's repo before installing mainly to triage how severe its issues are; this one seems fine apart from #3 which should be a very simple fix.
@yeradis is this package still being maintained? Would you like me to PR a fix for #3 or can you do it?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.