Skip to content

Commit

Permalink
ui: Update teachers schedule name displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
0niel committed Jan 3, 2024
1 parent 9fc2539 commit 6475c6b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/schedule/view/schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ class _SchedulePageState extends State<SchedulePage> {
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 {
Expand Down

0 comments on commit 6475c6b

Please sign in to comment.