61 lines
1.5 KiB
Dart
61 lines
1.5 KiB
Dart
enum AppThemeMode { system, light, dark, ugly }
|
|
|
|
enum AppLanguage { system, english, dutch }
|
|
|
|
class AppSettings {
|
|
final bool pinRequired;
|
|
final bool autoLockEnabled;
|
|
final AppThemeMode themeMode;
|
|
final AppLanguage language;
|
|
final int barGridRows;
|
|
|
|
const AppSettings({
|
|
required this.pinRequired,
|
|
this.autoLockEnabled = true,
|
|
required this.themeMode,
|
|
this.language = AppLanguage.system,
|
|
this.barGridRows = 3,
|
|
});
|
|
|
|
AppSettings copyWith({
|
|
bool? pinRequired,
|
|
bool? autoLockEnabled,
|
|
AppThemeMode? themeMode,
|
|
AppLanguage? language,
|
|
int? barGridRows,
|
|
}) {
|
|
return AppSettings(
|
|
pinRequired: pinRequired ?? this.pinRequired,
|
|
autoLockEnabled: autoLockEnabled ?? this.autoLockEnabled,
|
|
themeMode: themeMode ?? this.themeMode,
|
|
language: language ?? this.language,
|
|
barGridRows: barGridRows ?? this.barGridRows,
|
|
);
|
|
}
|
|
|
|
static const AppSettings defaults = AppSettings(
|
|
pinRequired: false,
|
|
autoLockEnabled: true,
|
|
themeMode: AppThemeMode.system,
|
|
);
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AppSettings &&
|
|
pinRequired == other.pinRequired &&
|
|
autoLockEnabled == other.autoLockEnabled &&
|
|
themeMode == other.themeMode &&
|
|
language == other.language &&
|
|
barGridRows == other.barGridRows;
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
pinRequired,
|
|
autoLockEnabled,
|
|
themeMode,
|
|
language,
|
|
barGridRows,
|
|
);
|
|
}
|