implemented custom subject colors for the timetable and unified the color palette system
This commit is contained in:
@@ -121,6 +121,27 @@ class TimetableBloc
|
||||
await _refreshCustomEvents();
|
||||
}
|
||||
|
||||
/// Setzt die persönliche Farbe eines Fachs (Schlüssel: Fach-Kürzel) und lädt
|
||||
/// die Fächer neu, damit die eingebettete Farbe im Kalender wirkt.
|
||||
Future<void> setSubjectColor(String subjectShort, String color) async {
|
||||
await repo.data.setSubjectColor(subjectShort, color);
|
||||
await _refreshSubjects();
|
||||
}
|
||||
|
||||
Future<void> clearSubjectColor(String subjectShort) async {
|
||||
await repo.data.removeSubjectColor(subjectShort);
|
||||
await _refreshSubjects();
|
||||
}
|
||||
|
||||
Future<void> _refreshSubjects() async {
|
||||
final subjects = await repo.data.getSubjects(renew: true);
|
||||
add(
|
||||
DataGathered(
|
||||
(s) => s.copyWith(subjects: subjects, dataVersion: s.dataVersion + 1),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _loadCurrentWeek(
|
||||
DateTime startDate,
|
||||
DateTime endDate, {
|
||||
|
||||
Reference in New Issue
Block a user