Skip to content

Commit

Permalink
修復「誤用 null courseMainInfo」的問題 (#229)
Browse files Browse the repository at this point in the history
* Fix: using widget value instead using courseMainInfo global variable

* Chore: Revert microtask statement

* Fix: courseMainInfo on L206
  • Loading branch information
ntut-xuan authored Feb 29, 2024
1 parent 3bf8666 commit 7cea4f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ui/pages/coursedetail/screen/course_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive

Future<List<CourseStudent>> _getCourseStudent() async {
TaskFlow taskFlow = TaskFlow();
final courseMainInfo = widget.courseInfo.main;
final task = IPlusGetStudentListTask(courseId: courseMainInfo.course.id);
taskFlow.addTask(task);
if (await taskFlow.start()) {
Expand Down Expand Up @@ -229,6 +230,7 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive

void _loadCourseStudent() async {
TaskFlow taskFlow = TaskFlow();
final courseMainInfo = widget.courseInfo.main;
final task = IPlusGetStudentListTask(courseId: courseMainInfo.course.id);
taskFlow.addTask(task);
if (await taskFlow.start()) {
Expand Down

0 comments on commit 7cea4f1

Please sign in to comment.