Initial project import and stabilization baseline

This commit is contained in:
dwindown
2026-03-30 21:28:44 +07:00
commit ad33b01231
186 changed files with 20445 additions and 0 deletions

52
lib/core/enums.dart Normal file
View File

@@ -0,0 +1,52 @@
/// App-wide state enums for the screen state machine.
library;
/// The 6 states the TV display cycles through.
enum ScreenState {
/// Normal rotation between MainScreen and Slideshow.
normal,
/// Pre-Adzan: Lock to MainScreen, show countdown.
menujuAdzan,
/// Adzan alert: Full-screen takeover.
adzan,
/// Iqomah countdown (or Friday Khutbah info).
menujuIqomah,
/// Black screen during prayer.
shalat,
/// Transitioning back to normal after prayer.
kembaliNormal,
}
/// Named prayer slots used across the app.
enum PrayerName {
imsak,
subuh,
terbit,
dhuha,
dzuhur,
ashar,
maghrib,
isya;
/// Display label — handles Friday override.
String displayLabel({bool isFriday = false}) {
if (this == PrayerName.dzuhur && isFriday) return 'JUMAT';
return id[0].toUpperCase() + id.substring(1);
}
/// Safe string identifier to replace .name
String get id => toString().split('.').last;
/// Whether this is a fardhu prayer (has iqomah).
bool get isFardhu =>
this == PrayerName.subuh ||
this == PrayerName.dzuhur ||
this == PrayerName.ashar ||
this == PrayerName.maghrib ||
this == PrayerName.isya;
}