|
|
|
|
@ -126,6 +126,8 @@ class ScreenConfigViewModel extends ChangeNotifier {
|
|
|
|
|
if (shouldUpdateNextPrayer) {
|
|
|
|
|
getNextPrayerToShow();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getInfoWidgetsDetailsFromServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getInfoWidgetsDetailsFromServer() async {
|
|
|
|
|
@ -158,9 +160,11 @@ class ScreenConfigViewModel extends ChangeNotifier {
|
|
|
|
|
PrayersWidgetModel prayersWidgetModel = PrayersWidgetModel();
|
|
|
|
|
|
|
|
|
|
Future<void> getPrayerDetailsFromServer() async {
|
|
|
|
|
double testLatitude = 24.722136;
|
|
|
|
|
double testLongitude = 46.774303;
|
|
|
|
|
PrayersWidgetModel? response = await screenDetailsRepo.getPrayerDetailsByLatLong(
|
|
|
|
|
latitude: globalConfigurationsModel.projectLatitude ?? 0.0,
|
|
|
|
|
longitude: globalConfigurationsModel.projectLongitude ?? 0.0,
|
|
|
|
|
latitude: globalConfigurationsModel.projectLatitude == 0.0 ? testLatitude : globalConfigurationsModel.projectLatitude ?? testLatitude,
|
|
|
|
|
longitude: globalConfigurationsModel.projectLongitude == 0.0 ? testLongitude : globalConfigurationsModel.projectLongitude ?? testLongitude,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response == null) {
|
|
|
|
|
@ -175,8 +179,9 @@ class ScreenConfigViewModel extends ChangeNotifier {
|
|
|
|
|
WeathersWidgetModel weathersWidgetModel = WeathersWidgetModel();
|
|
|
|
|
|
|
|
|
|
Future<void> getWeatherDetailsFromServer() async {
|
|
|
|
|
int testCityKey = 297030;
|
|
|
|
|
WeathersWidgetModel? response = await screenDetailsRepo.getWeatherDetailsByCity(
|
|
|
|
|
cityId: globalConfigurationsModel.cityKey.toString(),
|
|
|
|
|
cityId: (globalConfigurationsModel.cityKey == 0 ? testCityKey : globalConfigurationsModel.cityKey).toString(),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response == null) {
|
|
|
|
|
@ -188,10 +193,14 @@ class ScreenConfigViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
String nextPrayerToShowWithTime = '';
|
|
|
|
|
|
|
|
|
|
void getNextPrayerToShow() {
|
|
|
|
|
void getNextPrayerToShow() async {
|
|
|
|
|
final current = DateTime.now();
|
|
|
|
|
log("Checking Namaz time Locally at ${current.toString()} and ${current.timeZoneName} ");
|
|
|
|
|
|
|
|
|
|
if (globalConfigurationsModel.isPrayerTimeReq && prayersWidgetModel.fajr == null) {
|
|
|
|
|
await getPrayerDetailsFromServer();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prayersWidgetModel.fajr != null && prayersWidgetModel.fajr!.toDateTimeFromInt().isAfter(current)) {
|
|
|
|
|
final namazTime = prayersWidgetModel.fajr!.toFormattedDateTimeFromInt();
|
|
|
|
|
nextPrayerToShowWithTime = "${globalConfigurationsModel.fajarText} at $namazTime";
|
|
|
|
|
@ -280,7 +289,7 @@ class ScreenConfigViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> createAutoTickets({required int numOfTicketsToCreate}) async {
|
|
|
|
|
int startTicket = 123457000;
|
|
|
|
|
int startTicket = 123457100;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < numOfTicketsToCreate; i++) {
|
|
|
|
|
GenericRespModel? response = await screenDetailsRepo.createNextTickets(ticketNumber: startTicket);
|
|
|
|
|
|