Skip to content

Redesign Quran screen with tabbed interface and surah detail view#4

Merged
shceo merged 2 commits into
mainfrom
claude/add-quran-page-p9yYO
Mar 15, 2026
Merged

Redesign Quran screen with tabbed interface and surah detail view#4
shceo merged 2 commits into
mainfrom
claude/add-quran-page-p9yYO

Conversation

@ahksm

@ahksm ahksm commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Completely redesigned the Quran reading interface with a modern tabbed layout, surah detail screen with dual reading modes, and integration with the alquran.cloud API for fetching Quranic content.

Key Changes

Quran Screen Redesign

  • Replaced gradient background with dark theme (0xFF121212)
  • Implemented tabbed interface with 3 tabs: Surahs, Juz, and Bookmarks
  • Added header with menu, search, and settings icons
  • Added "Recently read" horizontal scroll section with quick access cards
  • Integrated TabController for tab management with SingleTickerProviderStateMixin
  • Refactored to use AnimatedBuilder for reactive UI updates

New Surah Detail Screen

  • Created SurahDetailScreen with two reading modes:
    • Ayah-by-Ayah mode: Vertical scrolling with individual ayah tiles, verse numbers, and translation toggle
    • Book mode: Horizontal page-based navigation (RTL swipe) with flowing Arabic text
  • Implemented ayah menu with bookmark, share, and copy options
  • Added top bar showing surah name, current page, juz, and hizb information
  • Bottom toolbar with translation toggle, mode switcher, and tafsir placeholder
  • Integrated with QuranService for fetching Arabic text and Russian translations

Data Models & Service Layer

  • Created quran_models.dart with:
    • SurahInfo: Surah metadata with Russian name mappings for all 114 surahs
    • Ayah: Verse data with juz, page, and hizb information
    • JuzInfo & JuzSurahRef: Juz division data
    • JuzData: Static mapping of all 30 juz with surah references
  • Created QuranService for API integration:
    • Fetches surahs list from alquran.cloud
    • Fetches surah Arabic text (Uthmani script)
    • Fetches Russian translations
    • Supports juz and page-based queries
    • Implements page caching for book mode

ViewModel Updates

  • Updated QuranViewModel to manage surah list loading
  • Added tab selection state management
  • Integrated with QuranService for data fetching
  • Proper error handling and loading states

UI Components

  • _RecentCard: Styled card for recently read surahs with verse reference
  • _SurahTile: List tile with surah number, name, ayah count, revelation type, and Arabic name
  • _JuzTile: Juz list item with juz number and starting surah reference
  • _JuzHeader: Section header for juz divisions
  • _BottomBarButton: Reusable bottom toolbar button component

Notable Implementation Details

  • Dark theme with accent color 0xFF2FC07F (green)
  • RTL support for Arabic text with proper TextDirection
  • Lazy loading of page data in book mode with caching
  • Proper resource cleanup with dispose methods
  • Error states with retry functionality
  • Russian localization for surah names and UI text

https://claude.ai/code/session_014sp5knSgELZvsmLpnnrkRX

claude added 2 commits March 15, 2026 09:10
- Integrate Al Quran Cloud API (api.alquran.cloud) for Arabic text + Russian translation (Kuliev)
- Add QuranService with endpoints for surahs, ayahs, juz data
- Create data models: SurahInfo (with 114 Russian names), Ayah, JuzInfo
- Redesign QuranScreen with dark theme, tabs (Суры/Джуз/Закладки),
  recently read section, and full surah list with juz headers
- Add SurahDetailScreen for reading ayahs with Arabic + translation toggle
- Update QuranViewModel with API loading state management

https://claude.ai/code/session_014sp5knSgELZvsmLpnnrkRX
- Ayah-by-ayah mode: vertical scroll, each ayah with surah:ayah badge,
  centered Arabic text, Russian translation below, 3-dot menu (bookmark/
  share/copy), dividers between ayahs
- Book mode: horizontal PageView (RTL swipe like real Quran), flowing
  Arabic text per page, surah headers with Arabic names, bismillah,
  page numbers at bottom
- Top bar: surah name, page/juz/hizb info, bookmark/search/settings
- Bottom toolbar: translation toggle, mode switch (Книга/Аяты), tafsir
- QuranService.fetchPage() for page-based data (604 Quran pages)
- Ayah model extended with hizbQuarter, surahNumber, surahName fields

https://claude.ai/code/session_014sp5knSgELZvsmLpnnrkRX
@shceo shceo merged commit 920c333 into main Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants