feat: deliver RSchedule service login exams and elastic glass navigation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'app_settings.dart';
|
||||
import 'course.dart';
|
||||
import 'semester.dart';
|
||||
import 'exam_schedule.dart';
|
||||
|
||||
class ImportMetadata {
|
||||
const ImportMetadata({
|
||||
@@ -18,6 +19,7 @@ class AppSnapshot {
|
||||
this.settings = const AppSettings(),
|
||||
List<Course> courses = const [],
|
||||
this.importMetadata,
|
||||
this.examSchedule,
|
||||
this.calendarCleanupPending = false,
|
||||
Map<String, String> calendarEventIds = const {},
|
||||
}) : courses = List.unmodifiable(courses),
|
||||
@@ -25,6 +27,7 @@ class AppSnapshot {
|
||||
final AppSettings settings;
|
||||
final List<Course> courses;
|
||||
final ImportMetadata? importMetadata;
|
||||
final ExamSchedule? examSchedule;
|
||||
final Map<String, String> calendarEventIds;
|
||||
final bool calendarCleanupPending;
|
||||
AppSnapshot copyWith({
|
||||
@@ -33,6 +36,8 @@ class AppSnapshot {
|
||||
ImportMetadata? importMetadata,
|
||||
Map<String, String>? calendarEventIds,
|
||||
bool clearMetadata = false,
|
||||
ExamSchedule? examSchedule,
|
||||
bool clearExams = false,
|
||||
bool? calendarCleanupPending,
|
||||
}) => AppSnapshot(
|
||||
settings: settings ?? this.settings,
|
||||
@@ -40,12 +45,14 @@ class AppSnapshot {
|
||||
importMetadata: clearMetadata
|
||||
? null
|
||||
: importMetadata ?? this.importMetadata,
|
||||
examSchedule: clearExams ? null : examSchedule ?? this.examSchedule,
|
||||
calendarEventIds: calendarEventIds ?? this.calendarEventIds,
|
||||
calendarCleanupPending:
|
||||
calendarCleanupPending ?? this.calendarCleanupPending,
|
||||
);
|
||||
Map<String, dynamic> toJson() => {
|
||||
'schemaVersion': 1,
|
||||
'examSchedule': examSchedule?.toJson(),
|
||||
'courses': courses.map((c) => c.toJson()).toList(),
|
||||
'settings': {
|
||||
'semester': settings.semester == null
|
||||
@@ -109,6 +116,11 @@ class AppSnapshot {
|
||||
);
|
||||
final metadata = json['importMetadata'];
|
||||
return AppSnapshot(
|
||||
examSchedule: json['examSchedule'] == null
|
||||
? null
|
||||
: ExamSchedule.fromJson(
|
||||
Map<String, dynamic>.from(json['examSchedule'] as Map),
|
||||
),
|
||||
calendarCleanupPending:
|
||||
(json['calendarCleanupPending'] ?? false) as bool,
|
||||
courses: values,
|
||||
|
||||
Reference in New Issue
Block a user