diff --git a/app/lib/groups/src/pages/course/create/course_create_page.dart b/app/lib/groups/src/pages/course/create/course_create_page.dart index 9c3c6856c..19274ff2b 100644 --- a/app/lib/groups/src/pages/course/create/course_create_page.dart +++ b/app/lib/groups/src/pages/course/create/course_create_page.dart @@ -19,6 +19,7 @@ Future openCourseCreatePage( Course? course, String? schoolClassId, }) async { + // We use `dynamic` as type because we return either a `Course?` or `bool`. final createdCourse = await Navigator.push( context, IgnoreWillPopScopeWhenIosSwipeBackRoute( @@ -38,7 +39,7 @@ Future openCourseCreatePage( seconds: 2, ); } - return createdCourse as Course; + return createdCourse is Course ? createdCourse : null; } Future submit(BuildContext context) async {