Skip to content

latitude more than 65: Error value should not be infinite or NaN #37

@m-alhamry

Description

@m-alhamry

Describe the bug
latitude values between (-67.5944046 and -90) and between (65.9277379 and 90)
throw Unhandled exception!

To Reproduce
minimum code that reproduce the error:

import 'package:adhan/adhan.dart';

void main() async {

  //latitude values between (-67.5944046 and -90) and between (65.9277379 and 90)
  //throw Unhandled exception!

  // var prayerTimes = PrayerTimes(Coordinates(-67.5944046, 120),
  //     DateComponents.from(DateTime.now()), CalculationMethod.umm_al_qura.getParameters());
  var prayerTimes = PrayerTimes(Coordinates(65.9277379, 120),
      DateComponents.from(DateTime.now()), CalculationMethod.umm_al_qura.getParameters());
  print(prayerTimes.fajr);
}

Expected behavior
should output the actual time of the giving parameters.

but it throws an error:

C:/Flutter_SDK/flutter/bin/cache/dart-sdk/bin/dart.exe --enable-asserts "E:\Flutter_UI\hij_greg_temp - Copy\lib\main.dart"
Unhandled exception:
Invalid argument(s): value should not be infinite or NaN
#0      TimeComponents.fromDouble (package:adhan/src/data/time_components.dart:12:7)
#1      new PrayerTimes._ (package:adhan/src/prayer_times.dart:133:37)
#2      new PrayerTimes (package:adhan/src/prayer_times.dart:53:24)
#3      main (package:hij_greg_temp/main.dart:10:21)
#4      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

Process finished with exit code 255

run flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 3.1.0-9.0.pre, on Microsoft Windows [Version 10.0.19043.1766], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.11.1)
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK
[√] Android Studio (version 2021.1)
[√] Android Studio (version 4.1)
[√] Android Studio (version 4.2)
[√] VS Code (version 1.68.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

Environment(please complete the following information):

  • Adhan-Dart Version: [adhan: ^2.0.0-nullsafety.2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions