-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latitute bigger than 75 throws an exception #61
Comments
The issue description is unclear. Can you please provide more details or clarify what you meant? |
void main() {
final p1 = getPrayersTimes(latitude: 74, longitude: 179); // this works as expected
final p2 = getPrayersTimes(latitude: 74, longitude: -179); // this works as expected/
final p3 = getPrayersTimes(latitude: 75, longitude: 179); //this throws an error
}
PrayerTimes? getPrayersTimes({required double latitude, required double longitude}) {
final myCoordinates = Coordinates(latitude, longitude,validate: true);
final params = CalculationMethod.egyptian.getParameters();
params.madhab = Madhab.shafi;
return PrayerTimes.today(myCoordinates, params);
}
Coordinates(this.latitude, this.longitude, {bool validate = false}) {
if (validate) {
if (!(latitude.isFinite && latitude.abs() <= 90)) {
throw ArgumentError(
'Invalid Latitude supplied, Latitude must be a number between -90 and 90');
}
if (!(longitude.isFinite && longitude.abs() <= 180)) {
throw ArgumentError(
'Invalid longitude supplied, Longitude must a number between -180 and 180');
}
}
}
|
May I ask why you're using static |
I'm actually doing that this is just a simplified version of my application to demonstrate the problem. Did you run the code? Is the problem reproducable? |
I have executed the code, and it generated the same |
Okay thanks for your effort |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Expected behavior
Latitude maxium value should be 90 not 75
Environment(please complete the following information):
The text was updated successfully, but these errors were encountered: