From 9bd7070aa321785402731c45002443c1e0d02964 Mon Sep 17 00:00:00 2001
From: Theo Wiese <theo.wiese@student.reutlingen-university.de>
Date: Thu, 8 May 2025 12:07:44 +0200
Subject: [PATCH] Fix linting issues

---
 lib/drawer/class_list_item.dart      | 5 ++---
 lib/timetable/lesson_chip.dart       | 6 +++---
 lib/timetable/period_background.dart | 2 +-
 lib/toolbar/toolbar.dart             | 2 +-
 lib/untis/element.dart               | 2 +-
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/drawer/class_list_item.dart b/lib/drawer/class_list_item.dart
index d27d5fb..63d31fb 100644
--- a/lib/drawer/class_list_item.dart
+++ b/lib/drawer/class_list_item.dart
@@ -25,9 +25,8 @@ class _ClassListItemState extends State<ClassListItem> {
       widget.appContext.profile.value!.selectedClasses;
   bool get isSelected => selectedClasses.contains(widget.cls.id);
 
-  List<Lecture>? get lectures => widget.appContext.lectures == null
-      ? null
-      : widget.appContext.lectures!.where(isRelevantLecture).toList();
+  List<Lecture>? get lectures =>
+      widget.appContext.lectures?.where(isRelevantLecture).toList();
 
   bool isRelevantLecture(Lecture lecture) {
     return lecture.code.startsWith(widget.cls.code);
diff --git a/lib/timetable/lesson_chip.dart b/lib/timetable/lesson_chip.dart
index ab0bb97..2847db3 100644
--- a/lib/timetable/lesson_chip.dart
+++ b/lib/timetable/lesson_chip.dart
@@ -16,10 +16,10 @@ class LessonChip extends StatelessWidget {
     return pressable ? theme.primaryColor : theme.iconTheme.color!;
   }
 
-  static MaterialStateColor getTextColor(BuildContext context) =>
-      MaterialStateColor.resolveWith((states) => getTextColorOfState(
+  static WidgetStateColor getTextColor(BuildContext context) =>
+      WidgetStateColor.resolveWith((states) => getTextColorOfState(
             context,
-            pressable: !states.contains(MaterialState.disabled),
+            pressable: !states.contains(WidgetState.disabled),
           ));
 
   @override
diff --git a/lib/timetable/period_background.dart b/lib/timetable/period_background.dart
index e836703..78ca2c6 100644
--- a/lib/timetable/period_background.dart
+++ b/lib/timetable/period_background.dart
@@ -18,7 +18,7 @@ class PeriodBackground extends StatelessWidget {
       offset: Offset(0, start * LessonWidget.zoom),
       child: Container(
         decoration: BoxDecoration(
-          color: Theme.of(context).colorScheme.surfaceVariant,
+          color: Theme.of(context).colorScheme.surfaceContainerHighest,
         ),
         height: (end - start) * LessonWidget.zoom,
       ),
diff --git a/lib/toolbar/toolbar.dart b/lib/toolbar/toolbar.dart
index 1273b0a..b8932d5 100644
--- a/lib/toolbar/toolbar.dart
+++ b/lib/toolbar/toolbar.dart
@@ -16,7 +16,7 @@ class _ToolbarState extends State<Toolbar> {
   @override
   Widget build(BuildContext context) {
     return Container(
-      color: Theme.of(context).colorScheme.background,
+      color: Theme.of(context).colorScheme.surface,
       child: Row(
         mainAxisAlignment: MainAxisAlignment.center,
         children: [
diff --git a/lib/untis/element.dart b/lib/untis/element.dart
index f75503f..c3fcd49 100644
--- a/lib/untis/element.dart
+++ b/lib/untis/element.dart
@@ -10,7 +10,7 @@ mixin UntisMixin {
   String toString() => name;
 
   @override
-  bool operator ==(dynamic other) {
+  bool operator ==(Object other) {
     if (other is! UntisElement) return false;
 
     return other.hashCode == hashCode;
-- 
GitLab