From 6475c6b2e75393165f555ebc974c7a6648a88bda Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:14:18 +0300 Subject: [PATCH] ui: Update teachers schedule name displaying --- lib/schedule/view/schedule_page.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/schedule/view/schedule_page.dart b/lib/schedule/view/schedule_page.dart index a178597f..2a4ae37d 100644 --- a/lib/schedule/view/schedule_page.dart +++ b/lib/schedule/view/schedule_page.dart @@ -42,7 +42,14 @@ class _SchedulePageState extends State { if (schedule is SelectedGroupSchedule) { return 'Расписание ${schedule.group.name}'; } else if (schedule is SelectedTeacherSchedule) { - return 'Расписание ${schedule.teacher.name}'; + var splittedName = schedule.teacher.name.split(' '); + if (splittedName.length == 3) { + return 'Расписание ${splittedName[0]} ${splittedName[1][0]}. ${splittedName[2][0]}.'; + } else if (splittedName.length == 2) { + return 'Расписание ${splittedName[0]} ${splittedName[1][0]}.'; + } else { + return 'Расписание ${schedule.teacher.name}'; + } } else if (schedule is SelectedClassroomSchedule) { return 'Расписание ${schedule.classroom.name}'; } else {