46 lines
1.5 KiB
Dart
46 lines
1.5 KiB
Dart
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,
|
|
this.courseHeightScale = defaultCourseHeightScale,
|
|
});
|
|
static const defaultCourseHeightScale = 1.25;
|
|
static const minCourseHeightScale = 0.8;
|
|
static const maxCourseHeightScale = 2.0;
|
|
final double courseHeightScale;
|
|
final Semester? semester;
|
|
final bool remindersEnabled, calendarEnabled;
|
|
final int reminderMinutes, singleColorArgb;
|
|
final ColorMode colorMode;
|
|
final String? calendarId;
|
|
AppSettings copyWith({
|
|
Semester? semester,
|
|
bool clearSemester = false,
|
|
bool? remindersEnabled,
|
|
int? reminderMinutes,
|
|
ColorMode? colorMode,
|
|
int? singleColorArgb,
|
|
bool? calendarEnabled,
|
|
String? calendarId,
|
|
double? courseHeightScale,
|
|
}) => AppSettings(
|
|
semester: clearSemester ? null : 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,
|
|
courseHeightScale: courseHeightScale ?? this.courseHeightScale,
|
|
);
|
|
}
|