QuranReaderController class
Lightweight state orchestrator for Quran reader screens.
Bridges individual service singletons into a single controller that screens can depend on. Exposes ValueNotifiers for reactive UI.
final controller = QuranReaderController();
await controller.init();
// Use in a screen:
QuranReaderScreen(controller: controller);
Constructors
- QuranReaderController({int initialPage = 1})
Properties
-
audioState
→ ValueNotifier<
QuranAudioState> -
Audio playback state.
no setter
-
chromeVisible
→ ValueNotifier<
bool> -
Whether the chrome (app bar, bottom bar) is visible.
final
- currentJuz → int
-
Current juz number for the active page.
no setter
-
currentPage
→ ValueNotifier<
int> -
Current page number (1-based, 1..604).
final
- currentSurah → SurahNameInfo?
-
Current surah info for the active page.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
highlightedAyah
→ ValueNotifier<
({int ayah, int surah})?> -
Currently highlighted ayah during audio playback.
final
-
isCurrentPageBookmarked
→ Future<
bool> -
Check if the current page is bookmarked.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → QuranSettingsService
-
Settings notifiers for reactive UI.
no setter
-
theme
→ ValueNotifier<
QuranReadingTheme> -
Active reading theme.
no setter
Methods
-
dispose(
) → void - Dispose all owned notifiers. Call when the screen is removed.
-
goToJuz(
int juz) → void - Navigate to a specific juz (jumps to its first page).
-
goToPage(
int page) → void - Navigate to a specific page.
-
goToSurah(
int surahNumber) → void - Navigate to a specific surah (jumps to its first page).
-
init(
) → Future< void> - Initialize controller — restores last page from storage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPageChanged(
int page) → void - Call when user changes page.
-
playAyah(
int surah, int ayah) → Future< void> - Play a specific ayah.
-
playSurahFrom(
int surah, {int startAyah = 1}) → Future< void> - Play from a surah starting at a specific ayah.
-
stopAudio(
) → void - Stop audio playback.
-
toggleBookmark(
) → Future< bool> - Toggle bookmark for the current page.
-
toggleChrome(
) → void - Toggle chrome visibility (app bar / bottom bar).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited