Giter VIP home page Giter VIP logo

Comments (16)

alamsz avatar alamsz commented on June 2, 2024 3

Thank you very much for updating the docs. Please allow my to add the following comments:

  • For Qibla, the docs is not clear to me, how to use it. Do you have an example? is this a compass ?
  • For the last item which is not clear to you , I mean by adding count down time for the remining time to next preayer like:
    Aser after 1:18:23

Sorry to chime in, the count down time should be pretty straightforward, and the library already has timeForPrayer method, which I think sufficient to calculate countdown timer, this is my implementation

 Timer(Duration(seconds: 1), () {
      var curTime = DateTime.now();
      var nextPrayerTime = prayerTime.timeForPrayer(prayerTimes.nextPrayer());
      var milisDiff = nextPrayerTime.millisecondsSinceEpoch -
          curTime.millisecondsSinceEpoch;
      var hourDiff = milisDiff ~/ 3600000;
      var minuteDiff = (milisDiff - hourDiff * 3600000) ~/ 60000;
      setState(() {
        textAdzanRemaining = 'next prayer in $hourDiff hour $minuteDiff minutes';
      });```

from adhan-dart.

alamsz avatar alamsz commented on June 2, 2024 1

@alamsz i want to implement same functionality to my app but i don't know how, i copy your code but it cannot work can you show me how to implement it

I've made simple example in https://github.com/lamsz/adzan it is deployed in https://adzan.lamsz.id/#/ hopefully could help you @muzohaib763

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

Just updated the doc, for SunnahTimes and Qibla.

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

2- can you please add the time of mid-night (calculated as the mean time from sunset to fajr)

3- can you please add the start time of the last third of the night.
(duration between sunset and fajr / 3 = i) (i + i + sunset time = start time of the last third of the night)

for these two please check SunnahTimes

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

1- if the current preayer is showing as (Prayer.isha) then the next Prayer is showing (Prayer.none). it should show (Prayer.fajr).

giving next prayer fajr at a date-changing point (24 hours a day) will be complicated to handle, and it will make complexity as there will be two fajr in the same PrayerTimes instance, which will be confusing. so handle the Prayer.none case with your own application's needs and logic.

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

2- if the time is now is after the Sunrise time, it shows (Prayer.sunrise). there is not prayer as sunrise.

Yes, there is!. there is a prayer called Ishraq.

The time for the Ishraq prayer begins fifteen to twenty minutes after sunrise and consists of two Raka'ahs. ... According to majority of scholars of Hadith and Fiqh, Duha Prayer and Al-Ishraq Prayer are all names of the same salah (ritual prayer).

https://en.wikipedia.org/wiki/Nafl_prayer#:~:text=The%20time%20for%20the%20Ishraq,consists%20of%20two%20Raka'ahs.&text=According%20to%20majority%20of%20scholars,same%20salah%20(ritual%20prayer).

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

1- can you please add (next prayer) is after ....... (count down time)

this is not clear to me.

from adhan-dart.

moosalim avatar moosalim commented on June 2, 2024

Thank you very much for updating the docs. Please allow my to add the following comments:

  • For Qibla, the docs is not clear to me, how to use it. Do you have an example? is this a compass ?
  • For the last item which is not clear to you , I mean by adding count down time for the remining time to next preayer like:
    Aser after 1:18:23

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

Thank you very much for updating the docs. Please allow my to add the following comments:

  • For Qibla, the docs is not clear to me, how to use it. Do you have an example? is this a compass ?
  • For the last item which is not clear to you , I mean by adding count down time for the remining time to next preayer like:
    Aser after 1:18:23

Sorry to chime in, the count down time should be pretty straightforward, and the library already has timeForPrayer method, which I think sufficient to calculate countdown timer, this is my implementation

 Timer(Duration(seconds: 1), () {
      var curTime = DateTime.now();
      var nextPrayerTime = prayerTime.timeForPrayer(prayerTimes.nextPrayer());
      var milisDiff = nextPrayerTime.millisecondsSinceEpoch -
          curTime.millisecondsSinceEpoch;
      var hourDiff = milisDiff ~/ 3600000;
      var minuteDiff = (milisDiff - hourDiff * 3600000) ~/ 60000;
      setState(() {
        textAdzanRemaining = 'next prayer in $hourDiff hour $minuteDiff minutes';
      });```

this is not a flutter specific flutter library, it's a dart library, so it should be usable everywhere. please try to understand, everything can't be pushed into the library.
the library follows the Adhan project.

from adhan-dart.

alamsz avatar alamsz commented on June 2, 2024

Thank you very much for updating the docs. Please allow my to add the following comments:

  • For Qibla, the docs is not clear to me, how to use it. Do you have an example? is this a compass ?
  • For the last item which is not clear to you , I mean by adding count down time for the remining time to next preayer like:
    Aser after 1:18:23

Sorry to chime in, the count down time should be pretty straightforward, and the library already has timeForPrayer method, which I think sufficient to calculate countdown timer, this is my implementation

 Timer(Duration(seconds: 1), () {
      var curTime = DateTime.now();
      var nextPrayerTime = prayerTime.timeForPrayer(prayerTimes.nextPrayer());
      var milisDiff = nextPrayerTime.millisecondsSinceEpoch -
          curTime.millisecondsSinceEpoch;
      var hourDiff = milisDiff ~/ 3600000;
      var minuteDiff = (milisDiff - hourDiff * 3600000) ~/ 60000;
      setState(() {
        textAdzanRemaining = 'next prayer in $hourDiff hour $minuteDiff minutes';
      });```

this is not a flutter specific flutter library, it's a dart library, so it should be usable everywhere. please try to understand, everything can't be pushed into the library.
the library follows the Adhan project.

Agree, I only point out that the library has sufficient method for dev to be able to implement it in flutter, and only giving example. My apologies if my comment causing confusion

from adhan-dart.

muzohaib763 avatar muzohaib763 commented on June 2, 2024

@alamsz i want to implement same functionality to my app but i don't know how, i copy your code but it cannot work can you show me how to implement it

from adhan-dart.

moosalim avatar moosalim commented on June 2, 2024

@alamsz
thanks for the code. but there is an issue, it does not work if the next prayer is Fajr.

from adhan-dart.

dijitalkale avatar dijitalkale commented on June 2, 2024

@alamsz
thanks for the code. but there is an issue, it does not work if the next prayer is Fajr.

did you solve the problem

from adhan-dart.

dijitalkale avatar dijitalkale commented on June 2, 2024

@alamsz
thanks for the code. but there is an issue, it does not work if the next prayer is Fajr.

did you solve the problem

Let me write the solution I found for those who come to this issue. below snippet will solve your problem.

var newDate = DateTime(
nextPrayerTime.year,
nextPrayerTime.month,
nextPrayerTime.day + 1, //we mark the next day
nextPrayerTime.hour,
nextPrayerTime.minute ,
nextPrayerTime.second,
nextPrayerTime.microsecond,
);

debugPrint(newDate.millisecondsSinceEpoch.toString());

from adhan-dart.

alamsz avatar alamsz commented on June 2, 2024

@alamsz
thanks for the code. but there is an issue, it does not work if the next prayer is Fajr.

did you solve the problem

it's not an issue actually, since the library regards Fajr in the next day, you only need to get the next day first prayer if it is none.

other alternative, you could give intermediate placeholder such as waiting for midnight, since after midnight next prayer will show fajr

from adhan-dart.

iamriajul avatar iamriajul commented on June 2, 2024

Here's my Kotlin version of Running & Next Prayer determination, this might help you write your own dart code: https://gist.github.com/2cdbc15d4fd0e8bad203205c9302a54b

Thanks.

from adhan-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.