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.
-
getCourseDetails(
String courseId) → Future< Course> - Gets detailed course catalog information.
-
getCourseOffering(
int id) → Future< CourseOffering?> - Gets a course offering with related data (teachers, classrooms, schedules).
-
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.
-
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.
-
watchSemesters(
) → Stream< List< Semester> > - Watches available semesters for the authenticated student.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited