claude refactorings, flutter best practices, platform dependent changes, general cleanup
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../mhslApi.dart';
|
||||
import 'addCustomTimetableEventParams.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);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../customTimetableEvent.dart';
|
||||
|
||||
part 'addCustomTimetableEventParams.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);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'addCustomTimetableEventParams.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()};
|
||||
Reference in New Issue
Block a user