feat: complete Simple Mode contextual routing and navigation state synchronization

This commit is contained in:
dwindown
2026-03-15 07:24:13 +07:00
parent faadc1865d
commit 25728583b3
21 changed files with 1095 additions and 320 deletions

View File

@@ -62,6 +62,9 @@ class AppSettings extends HiveObject {
@HiveField(18)
bool showTerjemahan;
@HiveField(19)
bool simpleMode; // false = Mode Lengkap, true = Mode Simpel
AppSettings({
this.userName = 'User',
this.userEmail = '',
@@ -82,6 +85,7 @@ class AppSettings extends HiveObject {
this.trackPuasa = false,
this.showLatin = true,
this.showTerjemahan = true,
this.simpleMode = false,
}) : adhanEnabled = adhanEnabled ??
{
'fajr': true,

View File

@@ -36,13 +36,14 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
trackPuasa: fields.containsKey(16) ? fields[16] as bool? ?? false : false,
showLatin: fields.containsKey(17) ? fields[17] as bool? ?? true : true,
showTerjemahan: fields.containsKey(18) ? fields[18] as bool? ?? true : true,
simpleMode: fields.containsKey(19) ? fields[19] as bool? ?? false : false,
);
}
@override
void write(BinaryWriter writer, AppSettings obj) {
writer
..writeByte(19)
..writeByte(20)
..writeByte(0)
..write(obj.userName)
..writeByte(1)
@@ -80,7 +81,9 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
..writeByte(17)
..write(obj.showLatin)
..writeByte(18)
..write(obj.showTerjemahan);
..write(obj.showTerjemahan)
..writeByte(19)
..write(obj.simpleMode);
}
@override

View File

@@ -3,6 +3,8 @@ import 'shalat_log.dart';
import 'tilawah_log.dart';
import 'dzikir_log.dart';
import 'puasa_log.dart';
import 'app_settings.dart';
import '../hive_boxes.dart';
part 'daily_worship_log.g.dart';
@@ -46,6 +48,11 @@ class DailyWorshipLog extends HiveObject {
/// Dynamically calculates the "Poin Ibadah" for this day.
int get totalPoints {
// Return 0 points if simple mode is active
final settingsBox = Hive.box<AppSettings>(HiveBoxes.settings);
final isSimpleMode = settingsBox.get('default')?.simpleMode ?? false;
if (isSimpleMode) return 0;
int points = 0;
// 1. Shalat Fardhu