claude refactorings, flutter best practices, platform dependent changes, general cleanup
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../mhsl_api.dart';
|
||||
import 'remove_custom_timetable_event_params.dart';
|
||||
|
||||
class RemoveCustomTimetableEvent extends MhslApi<void> {
|
||||
RemoveCustomTimetableEventParams params;
|
||||
|
||||
RemoveCustomTimetableEvent(this.params) : super('server/timetable/customEvents');
|
||||
|
||||
@override
|
||||
void assemble(String raw) {}
|
||||
|
||||
@override
|
||||
Future<Response>? request(Uri uri) => http.delete(uri, body: jsonEncode(params.toJson()));
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'remove_custom_timetable_event_params.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class RemoveCustomTimetableEventParams {
|
||||
String id;
|
||||
|
||||
RemoveCustomTimetableEventParams(this.id);
|
||||
|
||||
factory RemoveCustomTimetableEventParams.fromJson(Map<String, dynamic> json) => _$RemoveCustomTimetableEventParamsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$RemoveCustomTimetableEventParamsToJson(this);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'remove_custom_timetable_event_params.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RemoveCustomTimetableEventParams _$RemoveCustomTimetableEventParamsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => RemoveCustomTimetableEventParams(json['id'] as String);
|
||||
|
||||
Map<String, dynamic> _$RemoveCustomTimetableEventParamsToJson(
|
||||
RemoveCustomTimetableEventParams instance,
|
||||
) => <String, dynamic>{'id': instance.id};
|
||||
Reference in New Issue
Block a user