21 lines
529 B
Dart
21 lines
529 B
Dart
import 'dart:convert';
|
|
|
|
import '../../../requestCache.dart';
|
|
import 'getHolidays.dart';
|
|
import 'getHolidaysResponse.dart';
|
|
|
|
class GetHolidaysCache extends RequestCache<GetHolidaysResponse> {
|
|
GetHolidaysCache({onUpdate}) : super(RequestCache.cacheDay, onUpdate) {
|
|
start('MarianumMobile', 'wu-holidays');
|
|
}
|
|
|
|
@override
|
|
Future<GetHolidaysResponse> onLoad() {
|
|
return GetHolidays().run();
|
|
}
|
|
|
|
@override
|
|
GetHolidaysResponse onLocalData(String json) {
|
|
return GetHolidaysResponse.fromJson(jsonDecode(json));
|
|
}
|
|
} |