import 'dart:convert'; import '../../../requestCache.dart'; import 'getSubjects.dart'; import 'getSubjectsResponse.dart'; class GetSubjectsCache extends RequestCache { GetSubjectsCache({ void Function(GetSubjectsResponse)? onUpdate, void Function(Exception)? onError, bool? renew, }) : super( RequestCache.cacheHour, onUpdate, onError: onError ?? RequestCache.ignore, renew: renew, ) { start('wu-subjects'); } @override Future onLoad() => GetSubjects().run(); @override onLocalData(String json) => GetSubjectsResponse.fromJson(jsonDecode(json)); }