dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
@@ -11,7 +11,11 @@ class GetRooms extends WebuntisApi {
Future<GetRoomsResponse> run() async {
final rawAnswer = await query(this);
try {
return finalize(GetRoomsResponse.fromJson(jsonDecode(rawAnswer) as Map<String, dynamic>));
return finalize(
GetRoomsResponse.fromJson(
jsonDecode(rawAnswer) as Map<String, dynamic>,
),
);
} catch (e, trace) {
log(trace.toString());
log('Failed to parse getRoom data with server response: $rawAnswer');
@@ -19,5 +23,4 @@ class GetRooms extends WebuntisApi {
throw Exception('Failed to parse getRoom server response: $rawAnswer');
}
}
@@ -4,11 +4,11 @@ import 'get_rooms_response.dart';
class GetRoomsCache extends SimpleCache<GetRoomsResponse> {
GetRoomsCache({super.onUpdate, super.onError, super.renew})
: super(
cacheTime: RequestCache.cacheHour,
loader: () => GetRooms().run(),
fromJson: GetRoomsResponse.fromJson,
) {
: super(
cacheTime: RequestCache.cacheHour,
loader: () => GetRooms().run(),
fromJson: GetRoomsResponse.fromJson,
) {
start('wu-rooms');
}
}
@@ -10,7 +10,8 @@ class GetRoomsResponse extends ApiResponse {
GetRoomsResponse(this.result);
factory GetRoomsResponse.fromJson(Map<String, dynamic> json) => _$GetRoomsResponseFromJson(json);
factory GetRoomsResponse.fromJson(Map<String, dynamic> json) =>
_$GetRoomsResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetRoomsResponseToJson(this);
}
@@ -22,8 +23,15 @@ class GetRoomsResponseObject {
bool active;
String building;
GetRoomsResponseObject(this.id, this.name, this.longName, this.active, this.building);
GetRoomsResponseObject(
this.id,
this.name,
this.longName,
this.active,
this.building,
);
factory GetRoomsResponseObject.fromJson(Map<String, dynamic> json) => _$GetRoomsResponseObjectFromJson(json);
factory GetRoomsResponseObject.fromJson(Map<String, dynamic> json) =>
_$GetRoomsResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetRoomsResponseObjectToJson(this);
}