Skip to content

Commit

Permalink
Fix: using widget value instead using courseMainInfo global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ntut-xuan committed Feb 28, 2024
1 parent 97a78a3 commit 8ce06b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ui/pages/coursedetail/screen/course_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
super.initState();
isLoading = true;
BackButtonInterceptor.add(myInterceptor);
Future.microtask(() => _loadCourseStudent());
Future.delayed(Duration.zero, () {
_addTask();
});
Future.microtask(() => _loadCourseStudent());
}

@override
Expand Down Expand Up @@ -229,6 +229,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 8ce06b3

Please sign in to comment.