dart format
This commit is contained in:
@@ -9,10 +9,12 @@ import 'get_custom_timetable_event_response.dart';
|
||||
|
||||
class GetCustomTimetableEvent extends MhslApi<GetCustomTimetableEventResponse> {
|
||||
GetCustomTimetableEventParams params;
|
||||
GetCustomTimetableEvent(this.params) : super('server/timetable/customEvents?user=${params.user}');
|
||||
GetCustomTimetableEvent(this.params)
|
||||
: super('server/timetable/customEvents?user=${params.user}');
|
||||
|
||||
@override
|
||||
GetCustomTimetableEventResponse assemble(String raw) => GetCustomTimetableEventResponse.fromJson({'events': jsonDecode(raw)});
|
||||
GetCustomTimetableEventResponse assemble(String raw) =>
|
||||
GetCustomTimetableEventResponse.fromJson({'events': jsonDecode(raw)});
|
||||
|
||||
@override
|
||||
Future<Response>? request(Uri uri) => http.get(uri);
|
||||
|
||||
@@ -3,17 +3,18 @@ import 'get_custom_timetable_event.dart';
|
||||
import 'get_custom_timetable_event_params.dart';
|
||||
import 'get_custom_timetable_event_response.dart';
|
||||
|
||||
class GetCustomTimetableEventCache extends SimpleCache<GetCustomTimetableEventResponse> {
|
||||
class GetCustomTimetableEventCache
|
||||
extends SimpleCache<GetCustomTimetableEventResponse> {
|
||||
GetCustomTimetableEventCache(
|
||||
GetCustomTimetableEventParams params, {
|
||||
super.onUpdate,
|
||||
super.onError,
|
||||
super.renew,
|
||||
}) : super(
|
||||
cacheTime: RequestCache.cacheMinute,
|
||||
loader: () => GetCustomTimetableEvent(params).run(),
|
||||
fromJson: GetCustomTimetableEventResponse.fromJson,
|
||||
) {
|
||||
cacheTime: RequestCache.cacheMinute,
|
||||
loader: () => GetCustomTimetableEvent(params).run(),
|
||||
fromJson: GetCustomTimetableEventResponse.fromJson,
|
||||
) {
|
||||
start('customTimetableEvents');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ class GetCustomTimetableEventParams {
|
||||
|
||||
GetCustomTimetableEventParams(this.user);
|
||||
|
||||
factory GetCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$GetCustomTimetableEventParamsFromJson(json);
|
||||
factory GetCustomTimetableEventParams.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetCustomTimetableEventParamsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetCustomTimetableEventParamsToJson(this);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ class GetCustomTimetableEventResponse extends ApiResponse {
|
||||
|
||||
GetCustomTimetableEventResponse(this.events);
|
||||
|
||||
factory GetCustomTimetableEventResponse.fromJson(Map<String, dynamic> json) => _$GetCustomTimetableEventResponseFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetCustomTimetableEventResponseToJson(this);
|
||||
factory GetCustomTimetableEventResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetCustomTimetableEventResponseFromJson(json);
|
||||
Map<String, dynamic> toJson() =>
|
||||
_$GetCustomTimetableEventResponseToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user