updated project style guidelines

This commit is contained in:
2024-04-03 19:18:17 +02:00
parent 27618f4404
commit 4c7f53e309
185 changed files with 505 additions and 873 deletions

View File

@ -16,7 +16,7 @@ class AddCustomTimetableEvent extends MhslApi<void> {
@override
Future<Response>? request(Uri uri) {
String body = jsonEncode(params.toJson());
var body = jsonEncode(params.toJson());
return http.post(uri, body: body);
}
}
}

View File

@ -13,4 +13,4 @@ class AddCustomTimetableEventParams {
factory AddCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$AddCustomTimetableEventParamsFromJson(json);
Map<String, dynamic> toJson() => _$AddCustomTimetableEventParamsToJson(this);
}
}

View File

@ -25,4 +25,4 @@ class CustomTimetableEvent {
factory CustomTimetableEvent.fromJson(Map<String, dynamic> json) => _$CustomTimetableEventFromJson(json);
Map<String, dynamic> toJson() => _$CustomTimetableEventToJson(this);
}
}

View File

@ -12,12 +12,8 @@ class GetCustomTimetableEvent extends MhslApi<GetCustomTimetableEventResponse> {
GetCustomTimetableEvent(this.params) : super('server/timetable/customEvents?user=${params.user}');
@override
GetCustomTimetableEventResponse assemble(String raw) {
return GetCustomTimetableEventResponse.fromJson({'events': jsonDecode(raw)});
}
GetCustomTimetableEventResponse assemble(String raw) => GetCustomTimetableEventResponse.fromJson({'events': jsonDecode(raw)});
@override
Future<Response>? request(Uri uri) {
return http.get(uri);
}
}
Future<Response>? request(Uri uri) => http.get(uri);
}

View File

@ -13,12 +13,8 @@ class GetCustomTimetableEventCache extends RequestCache<GetCustomTimetableEventR
}
@override
Future<GetCustomTimetableEventResponse> onLoad() {
return GetCustomTimetableEvent(params).run();
}
Future<GetCustomTimetableEventResponse> onLoad() => GetCustomTimetableEvent(params).run();
@override
GetCustomTimetableEventResponse onLocalData(String json) {
return GetCustomTimetableEventResponse.fromJson(jsonDecode(json));
}
}
GetCustomTimetableEventResponse onLocalData(String json) => GetCustomTimetableEventResponse.fromJson(jsonDecode(json));
}

View File

@ -10,4 +10,4 @@ class GetCustomTimetableEventParams {
factory GetCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$GetCustomTimetableEventParamsFromJson(json);
Map<String, dynamic> toJson() => _$GetCustomTimetableEventParamsToJson(this);
}
}

View File

@ -13,4 +13,4 @@ class GetCustomTimetableEventResponse extends ApiResponse {
factory GetCustomTimetableEventResponse.fromJson(Map<String, dynamic> json) => _$GetCustomTimetableEventResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetCustomTimetableEventResponseToJson(this);
}
}

View File

@ -15,7 +15,5 @@ class RemoveCustomTimetableEvent extends MhslApi<void> {
void assemble(String raw) {}
@override
Future<Response>? request(Uri uri) {
return http.delete(uri, body: jsonEncode(params.toJson()));
}
}
Future<Response>? request(Uri uri) => http.delete(uri, body: jsonEncode(params.toJson()));
}

View File

@ -10,4 +10,4 @@ class RemoveCustomTimetableEventParams {
factory RemoveCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$RemoveCustomTimetableEventParamsFromJson(json);
Map<String, dynamic> toJson() => _$RemoveCustomTimetableEventParamsToJson(this);
}
}

View File

@ -15,7 +15,5 @@ class UpdateCustomTimetableEvent extends MhslApi<void> {
void assemble(String raw) {}
@override
Future<Response>? request(Uri uri) {
return http.patch(uri, body: jsonEncode(params.toJson()));
}
}
Future<Response>? request(Uri uri) => http.patch(uri, body: jsonEncode(params.toJson()));
}

View File

@ -14,4 +14,4 @@ class UpdateCustomTimetableEventParams {
factory UpdateCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$UpdateCustomTimetableEventParamsFromJson(json);
Map<String, dynamic> toJson() => _$UpdateCustomTimetableEventParamsToJson(this);
}
}