mushaf library

Digital mushaf engine for Flutter (Hafs & Warsh).

Classes

HafsQcf4Pack
Local root of a QCF4 Hafs layout (…/assets/quran/hafs_qcf4).
HafsQcf4PageView
Madinah Hafs page: one QCF4 font per page, one precomposed glyph per word.
HafsQcf4Store
In-memory QCF4 words and Madinah line map.
HafsQcfBasmalah
Decorative QCF2 basmala drawn with the shared chrome font.
MemoryMushafBookmarkStore
In-memory bookmarks.
MemoryMushafProgressStore
In-memory progress (useful for demos / tests).
Mushaf
Entry point for the mushaf engine.
MushafAssets
Global registry of riwayah asset packs + shared surahs path.
MushafAyah
Unified ayah model normalized from Hafs / Warsh JSON schemas.
MushafAyahMarker
End-of-ayah mark: widget circle, or TextSpan glyphs (۝ + digits).
MushafAyahRef
Identifies one ayah in a surah (1-based indices).
MushafAyahSearchResult
Word-search hit list with a total match count (may exceed ayahs.length).
MushafAyahSubLine
One visual row belonging to a Warsh ayah block (may share visualRow).
MushafBookmark
MushafBookmarkStore
Bookmark of a page or ayah.
MushafController
ChangeNotifier-based reader controller (no flutter_bloc dependency).
MushafFailure<T>
MushafFonts
Loads Unicode Quran font families registered with each riwayah pack.
MushafJustifiedText
Mushaf body: proportional lines — soft kashida, no extreme stretch.
MushafKashidaJustifier
Arabic mushaf justification via tatweel (كشيدة / U+0640).
MushafLine
MushafPage
One mushaf page from QPC V2 / Warsh layout JSON.
MushafPageFitter
Shared mushaf page-fit constants and span builders.
MushafPageNumberFrame
Centered mushaf folio: the page number between two short gold rules.
MushafPageView
Digital mushaf page from QPC V2 / Warsh layout JSON.
MushafProgress
MushafProgressStore
Persists last-read position per riwayah.
MushafReader
Hafs QCF4 and Warsh reader: ayah selection, page navigation, fullscreen, and book layout.
MushafReaderController
Drives MushafReader page turns and ayah highlight.
MushafReadingSettings
Reading options shared by Hafs and Warsh.
MushafRepository
Loads ayah corpora and mushaf page layouts from registered asset packs.
MushafResult<T>
Simple success/failure without app-specific networking types.
MushafRiwayahAssets
Registration payload for a riwayah's asset locations.
MushafStyle
Theme tokens for mushaf widgets — map from the host app ColorScheme.
MushafSuccess<T>
MushafSurah
MushafSurahList
Surah list with optional name search (no bundled translations).
MushafSurahNameFrame
Surah name inside the Islamic SVG cartouche frame.
MushafSurahSearchEntry
MushafSurahTitleBanner
Fallback plain banner (missing surah id / glyph).
MushafTypography
Uthmani typography — breaks Theme/DefaultTextStyle inheritance (Poppins/IBM Plex).
MushafWordToken
One glyph/word token on a mushaf line (Hafs QPC or Warsh Unicode).
QpcPageFonts
Loads QPC V2 page fonts + shared surah-name / QCF2 basmalah chrome fonts.
WarshMushafLayout
Geometry of the generated Warsh mushaf pages.
WarshVerticalFit
Result of WarshMushafLayout.verticalFit.

Enums

MushafBookmarkColor
Semantic ayah bookmark colors (not general UI tokens).
MushafLandscapeLayout
Landscape spread on a wide, short window.
MushafLineType
MushafPageDesign
Full-bleed page, or a page set inside a book frame.
MushafPageNavMode
Bottom page picker: thumbnails, or a scrubber that jumps on release.
MushafRiwayah
Supported mushaf riwayat.
MushafScrollDirection
Horizontal page turns, or a vertical stack of pages.

Extensions

MushafRiwayahDefaults on MushafRiwayah
MushafRiwayahX on MushafRiwayah
Convenience accessors for a registered riwayah pack.

Functions

hafsBookmarkInk(MushafBookmarkColor color) → Color
hafsJuzForPage(int page) → int
Madinah Hafs (604) juz start pages. Warsh uses the ayah corpus instead.
hafsQcf4AyahNumberStyle({required double fontSize, required bool dark, required Color color, Color? background}) → TextStyle
hafsQcf4FontSize(int page) → double
Portrait sizes tuned so each Madinah line fills the same width.
hafsQcf4GlyphStyle({required String family, required double fontSize, required Color color, Color? background}) → TextStyle
measureHafsQcf4PageWidth(int page, double fontScale) → double
Width of the longest line on page, so shorter lines can meet both edges.
measureMushafSpan({required InlineSpan span, required TextStyle style, required double maxWidth}) → double
Measures a span at maxWidth with centered RTL layout.
mushafPageSpan({required List<MushafAyah> ayahs, required Color ink, required double markerFontSize}) → InlineSpan
Rich ayah run (body + ayah-end marks) as pure TextSpans so word spacing stays natural and height can be measured without WidgetSpan gaps.
mushafSpreadWindow(Size size) → bool
Wide and short enough that two mushaf pages sit side by side.
registerMushafHafs({required String localRoot}) → void
Registers a downloaded Hafs pack rooted at localRoot (…/mushaf_packs/hafs with assets/... inside).
registerMushafHafsQcf4({required String localRoot}) → void
Registers a downloaded Hafs QCF4 pack rooted at localRoot (…/mushaf_packs/hafs with assets/quran/hafs_qcf4 inside).
registerMushafWarsh({required String localRoot}) → void
Registers a downloaded Warsh pack rooted at localRoot (…/mushaf_packs/warsh with assets/... inside).
resolveMushafAyahPage({required MushafRiwayah riwayah, required int surahId, required int ayahNumber}) → Future<int?>
Page of a Hafs QCF4 or Warsh ayah, after the matching pack is registered.
resolveMushafSurahPage({required MushafRiwayah riwayah, required int surahId}) → Future<int?>
First page of a surah for the active riwayah.

Typedefs

MushafSurahTap = void Function(MushafSurah surah)