feat: add validated semester and lesson calculations

This commit is contained in:
Codex
2026-10-12 23:13:02 +08:00
parent 36d18f029f
commit ae8e347e49
36 changed files with 1522 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
import 'semester.dart';
enum ColorMode { single, multicolor }
class AppSettings {
const AppSettings({
this.semester,
this.remindersEnabled = true,
this.reminderMinutes = 15,
this.colorMode = ColorMode.multicolor,
this.singleColorArgb = 0xFF348F91,
this.calendarEnabled = false,
this.calendarId,
});
final Semester? semester;
final bool remindersEnabled, calendarEnabled;
final int reminderMinutes, singleColorArgb;
final ColorMode colorMode;
final String? calendarId;
AppSettings copyWith({
Semester? semester,
bool? remindersEnabled,
int? reminderMinutes,
ColorMode? colorMode,
int? singleColorArgb,
bool? calendarEnabled,
String? calendarId,
}) => AppSettings(
semester: semester ?? this.semester,
remindersEnabled: remindersEnabled ?? this.remindersEnabled,
reminderMinutes: reminderMinutes ?? this.reminderMinutes,
colorMode: colorMode ?? this.colorMode,
singleColorArgb: singleColorArgb ?? this.singleColorArgb,
calendarEnabled: calendarEnabled ?? this.calendarEnabled,
calendarId: calendarId ?? this.calendarId,
);
}