implemented foreign timetable support for students, teachers, rooms, and classes, including a searchable element picker with favorites support, introduced a capabilities system for feature gating, refactored the timetable UI into a reusable TimetableCalendarView component, and redesigned the chat input field with a unified emoji picker and integrated attachment actions.

This commit is contained in:
2026-05-31 21:29:16 +02:00
parent 6e12da08c0
commit b6d06dd3b4
41 changed files with 2325 additions and 290 deletions
@@ -0,0 +1,29 @@
import 'package:dio/dio.dart';
import '../../errors/marianumconnect_error.dart';
import '../../marianumconnect_api.dart';
import '../../marianumconnect_endpoint.dart';
import 'timetable_get_teachers_response.dart';
class TimetableGetTeachers {
final Dio _dio;
TimetableGetTeachers({Dio? dio}) : _dio = dio ?? MarianumConnectApi.dio();
Future<TimetableGetTeachersResponse> run() async {
try {
final response = await _dio.get<List<dynamic>>(
MarianumConnectEndpoint.resolve('timetable/elements/teachers'),
);
final list = response.data!
.map(
(e) =>
McTimetableTeacherElement.fromJson(e as Map<String, dynamic>),
)
.toList();
return TimetableGetTeachersResponse(result: list);
} on DioException catch (e) {
throw mapMarianumConnectError(e);
}
}
}
@@ -0,0 +1,36 @@
import 'package:json_annotation/json_annotation.dart';
import '../../../api_response.dart';
part 'timetable_get_teachers_response.g.dart';
/// Picker list entry for a teacher. Named `...Element` to avoid colliding with
/// `McTimetableteacher` from the week response, which models the teacher *of a
/// lesson* (with substitution fields) rather than a selectable element.
@JsonSerializable(explicitToJson: true)
class McTimetableTeacherElement {
final int id;
final String shortName;
final String displayName;
McTimetableTeacherElement({
required this.id,
required this.shortName,
required this.displayName,
});
factory McTimetableTeacherElement.fromJson(Map<String, dynamic> json) =>
_$McTimetableTeacherElementFromJson(json);
Map<String, dynamic> toJson() => _$McTimetableTeacherElementToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TimetableGetTeachersResponse extends ApiResponse {
final List<McTimetableTeacherElement> result;
TimetableGetTeachersResponse({required this.result});
factory TimetableGetTeachersResponse.fromJson(Map<String, dynamic> json) =>
_$TimetableGetTeachersResponseFromJson(json);
Map<String, dynamic> toJson() => _$TimetableGetTeachersResponseToJson(this);
}
@@ -0,0 +1,45 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'timetable_get_teachers_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
McTimetableTeacherElement _$McTimetableTeacherElementFromJson(
Map<String, dynamic> json,
) => McTimetableTeacherElement(
id: (json['id'] as num).toInt(),
shortName: json['shortName'] as String,
displayName: json['displayName'] as String,
);
Map<String, dynamic> _$McTimetableTeacherElementToJson(
McTimetableTeacherElement instance,
) => <String, dynamic>{
'id': instance.id,
'shortName': instance.shortName,
'displayName': instance.displayName,
};
TimetableGetTeachersResponse _$TimetableGetTeachersResponseFromJson(
Map<String, dynamic> json,
) =>
TimetableGetTeachersResponse(
result: (json['result'] as List<dynamic>)
.map(
(e) =>
McTimetableTeacherElement.fromJson(e as Map<String, dynamic>),
)
.toList(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String),
);
Map<String, dynamic> _$TimetableGetTeachersResponseToJson(
TimetableGetTeachersResponse instance,
) => <String, dynamic>{
'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(),
};