CourseRepository class
Provides course schedules, catalog, materials, and student rosters.
final repo = ref.watch(courseRepositoryProvider);
// Observe available semesters (auto-refreshes when stale)
final stream = repo.watchSemesters();
// Force refresh (for pull-to-refresh)
await repo.refreshSemesters();
// Observe course schedule for a semester
final courseStream = repo.watchCourseTable(semester: semesters.first);
Constructors
- CourseRepository({required PortalService portalService, required CourseService courseService, required ISchoolPlusService iSchoolPlusService, required AppDatabase database, required AuthRepository authRepository, required FirebaseService firebaseService})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getCourse(
String code, {bool refresh = false}) → Future< Course> - Gets course catalog information by code.
-
getMaterialDownload(
CourseMaterial material) → Future< MaterialDto> - Gets the download URL for a material.
-
getMaterials(
CourseOffering courseOffering) → Future< List< CourseMaterial> > - Gets course materials (files, recordings, etc.) from I-School Plus.
-
getStudents(
CourseOffering courseOffering) → Future< List< Student> > - Gets students enrolled in a course from I-School Plus.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshCourseTable(
{required int semesterId}) → Future< void> - Fetches fresh course table data from network and writes to DB.
-
refreshSemesters(
) → Future< void> - Fetches fresh semester data from network and writes to DB.
-
refreshSyllabus(
{required int offeringId, required String teacherId}) → Future< void> -
Fetches teacher
teacherId's syllabus for offeringofferingIdand writes it back: content to a Syllabuses row (created on first fetch), instructor email to TeacherSemesters, and the shared header fields (course type, enrolled, withdrawn) to CourseOfferings. Deletes the row when the teacher hasn't submitted a syllabus (getSyllabusreturns null). -
toString(
) → String -
A string representation of this object.
inherited
-
watchCourseOffering(
String number) → Stream< CourseOfferingDetail?> - Watches a course offering's joined detail (overview + schedule + teachers
-
watchCourseTable(
{required int semesterId}) → Stream< CourseTableData> - Watches the course schedule for a semester with automatic background refresh.
-
watchSemesters(
) → Stream< List< Semester> > - Watches available semesters for the authenticated student.
-
watchSyllabus(
{required int offeringId, required String teacherId}) → Stream< Syllabus?> -
Watches the syllabus authored by
teacherIdfor offeringofferingId, refreshing it once per subscription (no staleness gate).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited