- Murattal: Spotify-style 5-button controls [Shuffle, Prev, Play, Next, Playlist] - Murattal: Animated 7-bar equalizer visualization in player circle - Murattal: Unsplash API background with frosted glass player overlay - Murattal: Transparent AppBar with backdrop blur - Murattal: Surah playlist bottom sheet with full 114 Surah list - Murattal: Auto-play disabled on screen open, enabled on navigation - Murattal: Shuffle mode for random Surah playback - Murattal: Photographer attribution per Unsplash guidelines - Dashboard: Auto-scroll prayer schedule to next active prayer - Fix: setState lifecycle errors on Reading & Murattal screens - Setup: flutter_dotenv, cached_network_image, url_launcher deps
102 lines
2.1 KiB
Dart
102 lines
2.1 KiB
Dart
import 'package:hive_flutter/hive_flutter.dart';
|
|
|
|
part 'app_settings.g.dart';
|
|
|
|
/// User settings stored in Hive.
|
|
@HiveType(typeId: 0)
|
|
class AppSettings extends HiveObject {
|
|
@HiveField(0)
|
|
String userName;
|
|
|
|
@HiveField(1)
|
|
String userEmail;
|
|
|
|
@HiveField(2)
|
|
int themeModeIndex; // 0=system, 1=light, 2=dark
|
|
|
|
@HiveField(3)
|
|
double arabicFontSize;
|
|
|
|
@HiveField(4)
|
|
String uiLanguage; // 'id' or 'en'
|
|
|
|
@HiveField(5)
|
|
Map<String, bool> adhanEnabled;
|
|
|
|
@HiveField(6)
|
|
Map<String, int> iqamahOffset; // minutes
|
|
|
|
@HiveField(7)
|
|
String? checklistReminderTime; // HH:mm format
|
|
|
|
@HiveField(8)
|
|
double? lastLat;
|
|
|
|
@HiveField(9)
|
|
double? lastLng;
|
|
|
|
@HiveField(10)
|
|
String? lastCityName;
|
|
|
|
@HiveField(11)
|
|
int rawatibLevel; // 0 = Off, 1 = Muakkad Only, 2 = Full
|
|
|
|
@HiveField(12)
|
|
int tilawahTargetValue;
|
|
|
|
@HiveField(13)
|
|
String tilawahTargetUnit; // 'Juz', 'Halaman', 'Ayat'
|
|
|
|
@HiveField(14)
|
|
bool tilawahAutoSync;
|
|
|
|
@HiveField(15)
|
|
bool trackDzikir;
|
|
|
|
@HiveField(16)
|
|
bool trackPuasa;
|
|
|
|
@HiveField(17)
|
|
bool showLatin;
|
|
|
|
@HiveField(18)
|
|
bool showTerjemahan;
|
|
|
|
AppSettings({
|
|
this.userName = 'User',
|
|
this.userEmail = '',
|
|
this.themeModeIndex = 0,
|
|
this.arabicFontSize = 24.0,
|
|
this.uiLanguage = 'id',
|
|
Map<String, bool>? adhanEnabled,
|
|
Map<String, int>? iqamahOffset,
|
|
this.checklistReminderTime = '09:00',
|
|
this.lastLat,
|
|
this.lastLng,
|
|
this.lastCityName,
|
|
this.rawatibLevel = 1, // Default to Muakkad
|
|
this.tilawahTargetValue = 1,
|
|
this.tilawahTargetUnit = 'Juz',
|
|
this.tilawahAutoSync = false,
|
|
this.trackDzikir = true,
|
|
this.trackPuasa = false,
|
|
this.showLatin = true,
|
|
this.showTerjemahan = true,
|
|
}) : adhanEnabled = adhanEnabled ??
|
|
{
|
|
'fajr': true,
|
|
'dhuhr': true,
|
|
'asr': true,
|
|
'maghrib': true,
|
|
'isha': true,
|
|
},
|
|
iqamahOffset = iqamahOffset ??
|
|
{
|
|
'fajr': 15,
|
|
'dhuhr': 10,
|
|
'asr': 10,
|
|
'maghrib': 5,
|
|
'isha': 10,
|
|
};
|
|
}
|