Closed moosalim closed 3 years ago
Just updated the doc, for SunnahTimes and Qibla.
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
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.
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).
1- can you please add (next prayer) is after ....... (count down time)
this is not clear to me.
Thank you very much for updating the docs. Please allow my to add the following comments:
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';
});```
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.
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
@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
@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
@alamsz thanks for the code. but there is an issue, it does not work if the next prayer is Fajr.
@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
@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());
@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
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.
Hello Brother.
There are issues with current preyer and next prayer , if you can pleas check and fix.
The issues are as follows:
1- if the current preayer is showing as (Prayer.isha) then the next Prayer is showing (Prayer.none). it should show (Prayer.fajr).
2- if the time is now is after the Sunrise time, it shows (Prayer.sunrise). there is not prayer as sunrise.
Also I have some suggestion to add more time calculations as follows:
1- can you please add (next prayer) is after ....... (count down time)
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)