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, FileSaveService? fileSaveService})

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

areMaterialsFresh(int courseOfferingId) → Future<bool>
Checks whether the material list was fetched within courseMaterialsTtl.
getCourse(String code, {bool refresh = false}) → Future<Course>
Gets course catalog information by code.
getCourseOffering(String number) → Future<CourseOfferingDetail?>
Reads number's offering detail (overview + schedule + teachers + classes), falling back to the course system when it is not cached.
getMaterialDownload(CourseMaterial material) → Future<MaterialDto>
Resolves current access information and caches only the material type.
isStudentRosterFresh(int courseOfferingId) → Future<bool>
Whether a roster has been fetched within studentRosterTtl.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readLatestCachedCourseTable() → Future<LatestCachedCourseTable?>
Reads the newest semester eligible for the course table without network access or interactive refresh side effects.
refreshCourseTable({required int semesterId}) → Future<void>
Fetches fresh course table data from network and writes to DB.
refreshMaterials({required int courseOfferingId, required String courseNumber}) → Future<void>
Replaces the cached material list after a successful authenticated fetch.
refreshSemesters() → Future<void>
Fetches fresh semester data from network and writes to DB.
refreshStudentRoster({required int courseOfferingId, required String courseNumber}) → Future<void>
Refreshes a course offering's student roster from I-School Plus.
refreshSyllabuses({required String courseNumber, required SyllabusLanguage language}) → Future<void>
Fetches every associated teacher's language syllabus for the offering identified by courseNumber and persists the complete result atomically.
saveMaterial(CourseMaterial material, {CancelToken? cancelToken, ProgressCallback? onReceiveProgress, void onSaving()?}) → Future<bool>
Downloads and exports a material, returning false when cancelled.
toString() → String
A string representation of this object.
inherited
watchCourseTable({required int semesterId}) → Stream<CourseTableData>
Watches the course schedule for a semester with automatic background refresh.
watchCourseTableCacheChanges() → Stream<void>
Emits when any table that affects the launcher timetable changes.
watchMaterials(int courseOfferingId) → Stream<CourseMaterialList>
Watches material references in manifest order, including cached empty lists.
watchSemesters() → Stream<List<Semester>>
Watches available semesters for the authenticated student.
watchStudentRoster(int courseOfferingId) → Stream<CourseStudentRoster>
Watches the cached I-School Plus student roster for courseOfferingId.
watchSyllabuses({required String courseNumber, required SyllabusLanguage language}) → Stream<List<TeacherSyllabusDetail>>
Watches every submitted language syllabus for the offering identified by courseNumber.

Operators

operator ==(Object other) → bool
The equality operator.
inherited