From 636c2ea68de488e3cc90e039c96998f8f1e80c36 Mon Sep 17 00:00:00 2001 From: Armand <4831c0@proton.me> Date: Mon, 2 Mar 2026 18:22:55 +0100 Subject: [PATCH] firka_wear: fix overflow if the lesson's room name or name is long --- .../lib/ui/wear/screens/home/home_screen.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/firka_wear/lib/ui/wear/screens/home/home_screen.dart b/firka_wear/lib/ui/wear/screens/home/home_screen.dart index 26d44d9..fa152e6 100644 --- a/firka_wear/lib/ui/wear/screens/home/home_screen.dart +++ b/firka_wear/lib/ui/wear/screens/home/home_screen.dart @@ -284,6 +284,18 @@ class _WearHomeScreenState extends State { ); } + var currentLessonText = + "${currentLesson.name}, ${currentLesson.roomName}"; + if (currentLessonText.length > 10) { + if (currentLesson.roomName!.length > 10) { + currentLessonText = + "${currentLesson.name}, ${currentLesson.roomName?.substring(0, 6) ?? ''}..."; + } else { + currentLessonText = + "${currentLesson.name.substring(0, 10)}, ${currentLesson.roomName}..."; + } + } + body.add( CustomPaint( painter: CircularProgressPainter( @@ -307,7 +319,7 @@ class _WearHomeScreenState extends State { const SizedBox(height: 4), Center( child: Text( - "${currentLesson.name}, ${currentLesson.roomName}", + currentLessonText, style: TextStyle( color: wearStyle.colors.textPrimary, fontSize: 14,