feat: add local reminders and owned calendar synchronization

This commit is contained in:
Codex
2026-10-13 00:11:48 +08:00
parent ffd3920c0d
commit 2c4256b880
13 changed files with 978 additions and 8 deletions
+8
View File
@@ -18,6 +18,7 @@ class AppSnapshot {
this.settings = const AppSettings(),
List<Course> courses = const [],
this.importMetadata,
this.calendarCleanupPending = false,
Map<String, String> calendarEventIds = const {},
}) : courses = List.unmodifiable(courses),
calendarEventIds = Map.unmodifiable(calendarEventIds);
@@ -25,12 +26,14 @@ class AppSnapshot {
final List<Course> courses;
final ImportMetadata? importMetadata;
final Map<String, String> calendarEventIds;
final bool calendarCleanupPending;
AppSnapshot copyWith({
AppSettings? settings,
List<Course>? courses,
ImportMetadata? importMetadata,
Map<String, String>? calendarEventIds,
bool clearMetadata = false,
bool? calendarCleanupPending,
}) => AppSnapshot(
settings: settings ?? this.settings,
courses: courses ?? this.courses,
@@ -38,6 +41,8 @@ class AppSnapshot {
? null
: importMetadata ?? this.importMetadata,
calendarEventIds: calendarEventIds ?? this.calendarEventIds,
calendarCleanupPending:
calendarCleanupPending ?? this.calendarCleanupPending,
);
Map<String, dynamic> toJson() => {
'schemaVersion': 1,
@@ -66,6 +71,7 @@ class AppSnapshot {
'parserVersion': importMetadata!.parserVersion,
},
'calendarEventIds': calendarEventIds,
'calendarCleanupPending': calendarCleanupPending,
};
static AppSnapshot fromJson(Map<String, dynamic> json) {
try {
@@ -93,6 +99,8 @@ class AppSnapshot {
);
final metadata = json['importMetadata'];
return AppSnapshot(
calendarCleanupPending:
(json['calendarCleanupPending'] ?? false) as bool,
courses: values,
settings: AppSettings(
semester: term,