From c9db496e59c6fbb345f1a601ab424063d9105034 Mon Sep 17 00:00:00 2001
From: Kima <kimavideos97@gmail.com>
Date: Sun, 5 May 2024 21:39:22 +0200
Subject: [PATCH] fixed text overflow and teacher custom name

---
 .../common/widgets/exam/exam_viewable.dart    | 20 ++++++++++++-------
 .../widgets/lesson/lesson_viewable.dart       |  8 +++++++-
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/refilc_mobile_ui/lib/common/widgets/exam/exam_viewable.dart b/refilc_mobile_ui/lib/common/widgets/exam/exam_viewable.dart
index c8b33be..60a67ab 100644
--- a/refilc_mobile_ui/lib/common/widgets/exam/exam_viewable.dart
+++ b/refilc_mobile_ui/lib/common/widgets/exam/exam_viewable.dart
@@ -210,13 +210,19 @@ class ExamPopup extends StatelessWidget {
                         Column(
                           crossAxisAlignment: CrossAxisAlignment.start,
                           children: [
-                            Text(
-                              exam.description.capital(),
-                              style: TextStyle(
-                                color:
-                                    AppColors.of(context).text.withOpacity(0.9),
-                                fontSize: 16.0,
-                                fontWeight: FontWeight.w600,
+                            SizedBox(
+                              width: MediaQuery.of(context).size.width * 0.7,
+                              child: Text(
+                                exam.description.capital(),
+                                style: TextStyle(
+                                  color: AppColors.of(context)
+                                      .text
+                                      .withOpacity(0.9),
+                                  fontSize: 16.0,
+                                  fontWeight: FontWeight.w600,
+                                ),
+                                maxLines: 3,
+                                overflow: TextOverflow.ellipsis,
                               ),
                             ),
                             Text(
diff --git a/refilc_mobile_ui/lib/common/widgets/lesson/lesson_viewable.dart b/refilc_mobile_ui/lib/common/widgets/lesson/lesson_viewable.dart
index b32e6b6..507c65e 100644
--- a/refilc_mobile_ui/lib/common/widgets/lesson/lesson_viewable.dart
+++ b/refilc_mobile_ui/lib/common/widgets/lesson/lesson_viewable.dart
@@ -466,7 +466,13 @@ class TimetableLessonPopup extends StatelessWidget {
                           height: 8.0,
                         ),
                         Text(
-                          lesson.teacher.name,
+                          (lesson.teacher.isRenamed &&
+                                  Provider.of<SettingsProvider>(context,
+                                          listen: false)
+                                      .renamedTeachersEnabled)
+                              ? (lesson.teacher.renamedTo ??
+                                  lesson.teacher.name)
+                              : lesson.teacher.name,
                           style: TextStyle(
                             color: AppColors.of(context).text.withOpacity(0.9),
                             fontSize: 14.0,