Skip to content

Commit

Permalink
Implement: Improved UI and add student count
Browse files Browse the repository at this point in the history
  • Loading branch information
ntut-xuan committed Mar 4, 2024
1 parent ef45e69 commit ad3faf3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/ui/pages/coursedetail/screen/course_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
courseExtraInfo = task.result;
}
widget.courseInfo.extra = courseExtraInfo;
List<CourseStudent> students = await _getCourseStudent();
Map<String, String> departmentMap = await _getCourseDepartmentMap();

courseData.add(_buildCourseInfo(sprintf("%s: %s", [R.current.courseId, courseMainInfo.course.id])));
courseData.add(_buildCourseInfo(sprintf("%s: %s", [R.current.courseName, courseMainInfo.course.name])));
courseData.add(_buildCourseInfo(sprintf("%s: %s ", [R.current.credit, courseMainInfo.course.credits])));
Expand All @@ -88,15 +91,17 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
courseMainInfo.getClassroomNameList(),
courseMainInfo.getClassroomHrefList(),
));
courseData.add(_buildCourseInfo(sprintf("%s: %s", [R.current.numberOfStudent, students.length])));

listItem.removeRange(0, listItem.length);
listItem.add(_buildInfoTitle(R.current.courseData));
listItem.addAll(courseData);

List<CourseStudent> students = await _getCourseStudent();
Map<String, String> departmentMap = await _getCourseDepartmentMap();


if (students.isNotEmpty) {
listItem.add(_buildInfoTitle(""));
listItem.add(_buildInfoTitle(R.current.studentList));
listItem.add(
Padding(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 0),
Expand Down

0 comments on commit ad3faf3

Please sign in to comment.