|
|
|
|
@ -185,6 +185,8 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
await setLastTimeUpdatedInCache(lasTimeUpdated: currentDate.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int counter = 0;
|
|
|
|
|
|
|
|
|
|
Future<void> getTheWidgetsConfigurationsEveryMidnight() async {
|
|
|
|
|
if (currentWidgetsConfigModel == null) return;
|
|
|
|
|
if (!currentWidgetsConfigModel!.isWeatherReq! && !currentWidgetsConfigModel!.isPrayerTimeReq! && !currentWidgetsConfigModel!.isRssFeedReq!) {
|
|
|
|
|
@ -197,14 +199,17 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
return current;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Stream timerForRssFeed = Stream.periodic(const Duration(hours: 1), (i) {
|
|
|
|
|
current = current.add(const Duration(hours: 1));
|
|
|
|
|
return current;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
timer.listen((data) async {
|
|
|
|
|
DateTime dateTime = DateTime.parse(data.toString());
|
|
|
|
|
|
|
|
|
|
counter++;
|
|
|
|
|
|
|
|
|
|
log("counterValue: $counter");
|
|
|
|
|
|
|
|
|
|
if (counter == 60 && currentWidgetsConfigModel!.isRssFeedReq!) {
|
|
|
|
|
await getRssFeedDetailsFromServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentWidgetsConfigModel!.isWeatherReq!) {
|
|
|
|
|
if (dateTime.day > currentLastTimeUpdated.day) {
|
|
|
|
|
await getWeatherDetailsFromServer();
|
|
|
|
|
@ -224,12 +229,6 @@ class AppProvider extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
getNextPrayerToShow();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
timerForRssFeed.listen((data) async {
|
|
|
|
|
if (currentWidgetsConfigModel!.isRssFeedReq!) {
|
|
|
|
|
await getRssFeedDetailsFromServer();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> startSignalHubConnection() async {
|
|
|
|
|
|