Skip to content

Commit

Permalink
fixed update timing
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchalyadav272 committed Jun 30, 2023
1 parent bad1bec commit 019016a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/functions/utility/check_last_updated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Future<bool> checkLastUpdated() async {
final prefs = await SharedPreferences.getInstance();
prefs.remove('messMenu');
}
if (key.toLowerCase() == "timing") {
final prefs = await SharedPreferences.getInstance();
prefs.remove('busTimings');
prefs.remove('ferryTimings');
}

recordNames[key]?.forEach((element) async {
await LocalStorage.instance.deleteRecord(element);
});
Expand Down
16 changes: 16 additions & 0 deletions lib/services/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,22 @@ final dio2 = Dio(BaseOptions(
for (var element in busData) {
busTimings.add(TravelTiming.fromJson(element));
}
// for(int i=0;i<busTimings[0].weekdays.toCampus.length;i++){
// busTimings[0].weekdays.toCampus[i]=busTimings[0].weekdays.toCampus[i].add(const Duration(hours: 5,minutes: 30));
// print(busTimings[0].weekdays.toCampus[i]);
// }
// for(int i=0;i<busTimings[0].weekdays.fromCampus.length;i++){
// busTimings[0].weekdays.fromCampus[i]=busTimings[0].weekdays.fromCampus[i].add(const Duration(hours: 5,minutes: 30));
// print(busTimings[0].weekdays.fromCampus[i]);
// }
// for(int i=0;i<busTimings[0].weekend.toCampus.length;i++){
// busTimings[0].weekend.toCampus[i]=busTimings[0].weekend.toCampus[i].add(const Duration(hours: 5,minutes: 30));
// print(busTimings[0].weekend.toCampus[i]);
// }
// for(int i=0;i<busTimings[0].weekend.fromCampus.length;i++){
// busTimings[0].weekend.fromCampus[i]=busTimings[0].weekend.fromCampus[i].add(const Duration(hours: 5,minutes: 30));
// print(busTimings[0].weekend.fromCampus[i]);
// }
print("here at length");
print(busTimings.length);
return busTimings;
Expand Down

0 comments on commit 019016a

Please sign in to comment.