Harden app for 24-7 offline-first operation
This commit is contained in:
@@ -77,6 +77,10 @@ class AppSettings extends HiveObject {
|
||||
@HiveField(19)
|
||||
String? lastSyncDate;
|
||||
|
||||
// Last automatic sync attempt timestamp (ISO8601).
|
||||
@HiveField(32)
|
||||
String? lastAutoSyncAttemptDate;
|
||||
|
||||
// Slideshow image paths (local)
|
||||
@HiveField(20)
|
||||
List<String> slideshowImages;
|
||||
@@ -148,6 +152,7 @@ class AppSettings extends HiveObject {
|
||||
this.mainScreenDurationSec = 15,
|
||||
this.slideDurationSec = 10,
|
||||
this.lastSyncDate,
|
||||
this.lastAutoSyncAttemptDate,
|
||||
this.slideshowImages = const [],
|
||||
this.textScaleIndex = 1,
|
||||
this.useUnsplashBackground = false,
|
||||
@@ -183,6 +188,7 @@ class AppSettings extends HiveObject {
|
||||
int? mainScreenDurationSec,
|
||||
int? slideDurationSec,
|
||||
String? lastSyncDate,
|
||||
String? lastAutoSyncAttemptDate,
|
||||
List<String>? slideshowImages,
|
||||
int? textScaleIndex,
|
||||
bool? useUnsplashBackground,
|
||||
@@ -217,6 +223,8 @@ class AppSettings extends HiveObject {
|
||||
mainScreenDurationSec: mainScreenDurationSec ?? this.mainScreenDurationSec,
|
||||
slideDurationSec: slideDurationSec ?? this.slideDurationSec,
|
||||
lastSyncDate: lastSyncDate ?? this.lastSyncDate,
|
||||
lastAutoSyncAttemptDate:
|
||||
lastAutoSyncAttemptDate ?? this.lastAutoSyncAttemptDate,
|
||||
slideshowImages: slideshowImages ?? this.slideshowImages,
|
||||
textScaleIndex: textScaleIndex ?? this.textScaleIndex,
|
||||
useUnsplashBackground: useUnsplashBackground ?? this.useUnsplashBackground,
|
||||
@@ -266,6 +274,7 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
|
||||
mainScreenDurationSec: fields[17] as int? ?? 15,
|
||||
slideDurationSec: fields[18] as int? ?? 10,
|
||||
lastSyncDate: fields[19] as String?,
|
||||
lastAutoSyncAttemptDate: fields[32] as String?,
|
||||
slideshowImages: (fields[20] as List?)?.cast<String>() ?? const [],
|
||||
textScaleIndex: fields[21] as int? ?? 1,
|
||||
useUnsplashBackground: fields[22] as bool? ?? false,
|
||||
@@ -284,7 +293,7 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
|
||||
@override
|
||||
void write(BinaryWriter writer, AppSettings obj) {
|
||||
writer
|
||||
..writeByte(32)
|
||||
..writeByte(33)
|
||||
..writeByte(0)..write(obj.masjidName)
|
||||
..writeByte(1)..write(obj.masjidAddress)
|
||||
..writeByte(2)..write(obj.cityIdApi)
|
||||
@@ -305,6 +314,7 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
|
||||
..writeByte(17)..write(obj.mainScreenDurationSec)
|
||||
..writeByte(18)..write(obj.slideDurationSec)
|
||||
..writeByte(19)..write(obj.lastSyncDate)
|
||||
..writeByte(32)..write(obj.lastAutoSyncAttemptDate)
|
||||
..writeByte(20)..write(obj.slideshowImages)
|
||||
..writeByte(21)..write(obj.textScaleIndex)
|
||||
..writeByte(22)..write(obj.useUnsplashBackground)
|
||||
|
||||
Reference in New Issue
Block a user