replaced generic "Event" label with substitution or lesson text
This commit is contained in:
@@ -14,6 +14,7 @@ import '../view/pages/timetable/data/lesson_labels.dart';
|
||||
import '../view/pages/timetable/data/lesson_merger.dart';
|
||||
import '../view/pages/timetable/data/lesson_period_schedule.dart';
|
||||
import '../view/pages/timetable/data/lesson_status.dart';
|
||||
import '../view/pages/timetable/data/lesson_type_label.dart';
|
||||
import 'widget_data.dart';
|
||||
|
||||
class WidgetDataMapper {
|
||||
@@ -326,9 +327,11 @@ class WidgetDataMapper {
|
||||
LessonStatusClassifier.classify(lesson, start, end, now),
|
||||
);
|
||||
final subjectShortRaw = lesson.subjects.firstOrNull?.trim() ?? '';
|
||||
// Webuntis sometimes ships subject-less entries (Wandertag etc.). Fall
|
||||
// back to "Event" so the tile isn't just a dash.
|
||||
final subjectShort = subjectShortRaw.isEmpty ? 'Event' : subjectShortRaw;
|
||||
// Webuntis sometimes ships subject-less entries (Wandertag etc.). Prefer
|
||||
// their free text, else "Event" so the tile isn't just a dash.
|
||||
final subjectShort = subjectShortRaw.isEmpty
|
||||
? LessonTypeLabel.entryText(lesson) ?? LessonTypeLabel.fallback
|
||||
: subjectShortRaw;
|
||||
String? subjectLong;
|
||||
if (subjects != null && subjectShortRaw.isNotEmpty) {
|
||||
subjectLong = subjects.result
|
||||
|
||||
Reference in New Issue
Block a user