Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

回復「修課人數」並且新增「學生清單」標題 #233

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 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();

Comment on lines +73 to +75
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using final

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,15 @@ 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
Loading