claude refactorings, flutter best practices, platform dependent changes, general cleanup

This commit is contained in:
2026-05-06 11:58:50 +02:00
parent 4b1d4379a0
commit 4e1272aba9
281 changed files with 1948 additions and 1041 deletions
@@ -0,0 +1,22 @@
import 'dart:convert';
import 'package:http/http.dart';
import 'package:http/http.dart' as http;
import '../../mhsl_api.dart';
import 'add_custom_timetable_event_params.dart';
class AddCustomTimetableEvent extends MhslApi<void> {
AddCustomTimetableEventParams params;
AddCustomTimetableEvent(this.params) : super('server/timetable/customEvents');
@override
void assemble(String raw) {}
@override
Future<Response>? request(Uri uri) {
var body = jsonEncode(params.toJson());
return http.post(uri, body: body);
}
}
@@ -0,0 +1,16 @@
import 'package:json_annotation/json_annotation.dart';
import '../custom_timetable_event.dart';
part 'add_custom_timetable_event_params.g.dart';
@JsonSerializable(explicitToJson: true)
class AddCustomTimetableEventParams {
String user;
CustomTimetableEvent event;
AddCustomTimetableEventParams(this.user, this.event);
factory AddCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$AddCustomTimetableEventParamsFromJson(json);
Map<String, dynamic> toJson() => _$AddCustomTimetableEventParamsToJson(this);
}
@@ -0,0 +1,18 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'add_custom_timetable_event_params.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AddCustomTimetableEventParams _$AddCustomTimetableEventParamsFromJson(
Map<String, dynamic> json,
) => AddCustomTimetableEventParams(
json['user'] as String,
CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>),
);
Map<String, dynamic> _$AddCustomTimetableEventParamsToJson(
AddCustomTimetableEventParams instance,
) => <String, dynamic>{'user': instance.user, 'event': instance.event.toJson()};