Implement Webuntis HTTP Api and Display
This commit is contained in:
23
lib/api/webuntis/queries/getRooms/getRoomsCache.dart
Normal file
23
lib/api/webuntis/queries/getRooms/getRoomsCache.dart
Normal file
@ -0,0 +1,23 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:marianum_mobile/api/requestCache.dart';
|
||||
import 'package:marianum_mobile/api/webuntis/queries/getRooms/getRoomsResponse.dart';
|
||||
|
||||
import 'getRooms.dart';
|
||||
|
||||
class GetRoomsCache extends RequestCache<GetRoomsResponse> {
|
||||
GetRoomsCache({onUpdate}) : super(60 * 60, onUpdate) {
|
||||
start("rooms", "data");
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GetRoomsResponse> onLoad() {
|
||||
return GetRooms().run();
|
||||
}
|
||||
|
||||
@override
|
||||
GetRoomsResponse onLocalData(String json) {
|
||||
return GetRoomsResponse.fromJson(jsonDecode(json));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user