CalendarRepository class
Manages academic calendar events from the NTUT portal.
Caches a sliding window that spans the student's enrolled semesters plus a short buffer — reads within that window hit the DB, so month-to-month UI navigation never goes to the network.
final repo = ref.watch(calendarRepositoryProvider);
final stream = repo.watchCalendarEvents(
startDate: start,
endDate: end,
);
await repo.refreshCalendarEvents(); // pull-to-refresh
Constructors
- CalendarRepository({required PortalService portalService, required AppDatabase database, required AuthRepository authRepository})
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshCalendarEvents(
) → Future< void> - Fetches fresh calendar data for the student's semester lifetime window and writes it to the DB.
-
toString(
) → String -
A string representation of this object.
inherited
-
watchCalendarEvents(
{required DateTime startDate, required DateTime endDate}) → Stream< List< CalendarEvent> > - Watches calendar events overlapping the given date range.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited