implemented custom subject colors for the timetable and unified the color palette system

This commit is contained in:
2026-07-12 21:30:08 +02:00
parent a7111844b1
commit fe2b3c43b2
23 changed files with 916 additions and 89 deletions
@@ -10,10 +10,15 @@ class McSubject {
final String shortName;
final String longName;
/// Persönliche Fach-Farbe (Palette-Name aus [SubjectColor]), serverseitig pro
/// Nutzer gepflegt. `null`, wenn für dieses Fach keine Farbe gesetzt ist.
final String? color;
McSubject({
required this.id,
required this.shortName,
required this.longName,
this.color,
});
factory McSubject.fromJson(Map<String, dynamic> json) =>
@@ -10,12 +10,14 @@ McSubject _$McSubjectFromJson(Map<String, dynamic> json) => McSubject(
id: (json['id'] as num).toInt(),
shortName: json['shortName'] as String,
longName: json['longName'] as String,
color: json['color'] as String?,
);
Map<String, dynamic> _$McSubjectToJson(McSubject instance) => <String, dynamic>{
'id': instance.id,
'shortName': instance.shortName,
'longName': instance.longName,
'color': instance.color,
};
TimetableGetSubjectsResponse _$TimetableGetSubjectsResponseFromJson(