feat: add two-tab timetable UI and glass dock

This commit is contained in:
Codex
2026-10-12 23:33:33 +08:00
parent 808af007a2
commit 8a98d49d12
17 changed files with 1912 additions and 9 deletions
+4 -2
View File
@@ -18,8 +18,9 @@ class ImportDraft {
class JsonScheduleImport {
static ImportDraft parse(String text) {
try {
if (utf8.encode(text).length > 2 * 1024 * 1024)
if (utf8.encode(text).length > 2 * 1024 * 1024) {
throw const FormatException('文件不能超过 2 MB');
}
final json = jsonDecode(text);
if (json is! Map ||
json['schemaVersion'] != 1 ||
@@ -40,8 +41,9 @@ class JsonScheduleImport {
),
)
.toList();
if (courses.map((c) => c.id).toSet().length != courses.length)
if (courses.map((c) => c.id).toSet().length != courses.length) {
throw const FormatException('课程标识重复');
}
return ImportDraft(
courses: List.unmodifiable(courses),
explicitlyEmpty: json['explicitlyEmpty'] == true,