Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ Dynamic search reciter #1351

Merged
merged 14 commits into from
Oct 14, 2024
Merged

Conversation

ghassenbenzahra123
Copy link
Contributor

📝 Summary

This PR fixes #1226

📝 Screenshots

20241002_123212.mp4

Checklist:

  • Coding Standards: I have reviewed my code to ensure it follows the project's coding standards.
  • Testing: I have tested the changes and they work as expected.
  • Merge Conflicts: I have resolved any merge conflicts with the latest main/development branch.
  • Branch Status: The branch is up-to-date with the target branch (main/development).

ghassenbenzahra123 and others added 11 commits October 11, 2024 21:25
* feat: add `kHafsQuranLocalVersion`, `kWarshQuranLocalVersion`, `kSelectedMoshafType`

* feat: add `switchQuranType` localization

* feat: Refactor Quran Download and Reading Logic

- Introduced `MoshafType` as a parameter in various functions to support multiple Quran versions.
- Updated `DownloadQuranLocalDataSource` to handle versioning based on `MoshafType`.
- Enhanced `DownloadQuranState` with states for checking downloads and handling errors.
- Refactored Notifiers and Repositories to include `MoshafType` in state management.
- Improved the UI with a new `DownloadQuranDialog` for better user interaction during downloads.
- Cleaned up redundant code and improved error handling across the application.

* refactor

* refactor: Quran Download and Reading Logic

- Updated `download_quran_popup.dart` to streamline dialog handling and improve state management.
- Changed `getLocalQuranVersion` in `quran_download_repository.dart` to return an `Option<String>` for better null safety.
- Enhanced `download_quran_notifier.dart` for more efficient state transitions and error handling.
- Refactored local data operations in `download_quran_local_data_source.dart` to utilize `Option` for version management.
- Improved moshaf switching logic in `moshaf_type_notifier.dart` and related UI components.
- Removed unnecessary dialog calls in `quran_reading_screen.dart` to prevent duplicate dialogs.

* feat: add First-Time User Logic for Quran Moshaf Selection

- Introduced `isFirstTime` property in `MoshafState` to track first-time usage.
- Updated `download_quran_notifier.dart` to prompt downloads for first-time users.
- Enhanced `moshaf_type_notifier.dart` to initialize `isFirstTime` from shared preferences.
- Added `setNotFirstTime` method to update the state after the first download.
- Defined a constant for first-time usage in `constants.dart`.

* fix: download_quran_local and download_quran_remote unit tests

* reformat

* fix: auto focus node at the quran reading screen

* fix focus at the reading

* fix: solve focus issue

* feat: add pop up for informing if download

* fix: icon button for back and switch pages is not solid color at the focus mode

* fix reformat

* add surah selector

* extract filter to seperate widget

* fix conflicts & merge main branch

* feat: add language_code in the constant file

* refactor: Quran Surah Selector and State Management

Changes:

- Quran Surah Selector:
  - Added `Sizer` package for responsive font sizing.
  - Updated font size in `showSurahSelector` to use `sp` for scalable text.
  - Removed `StatefulBuilder` for simplification.
  - Added `autofocus` to the first item in the grid for improved accessibility.

- Quran Reading Screen:
  - Adjusted top positioning of a widget for better layout.
  - Integrated `getAllSuwarPage` call before showing the surah selector to ensure data is loaded.

- Quran Reading Notifier:
  - Replaced import for `quran_notifier`.
  - Removed unnecessary logging.
  - Added `getAllSuwarPage` method to update surah data based on language preference.

* refactor: Introduced `getAllSuwarPage` and `getAllSuwar` methods to fetch surah data based on language settings.

Changes:

- QuranReadingNotifier:
  - Introduced `getAllSuwarPage` and `getAllSuwar` methods to fetch surah data based on language settings.
  - Optimized `_initState` to initialize state with surah and SVG data.
  - Enhanced `_getCurrentSurahName` with binary search for efficient surah name retrieval.
  - Cleaned up exception handling in `_saveLastReadPage`.

* remove logs

* reformat

* refactor: change from `Positioned` into `Align`

* feat: Add Auto-Scrolling to Surah Selector

- Added `scroll_to_index` package for automatic scrolling.
- Implemented `AutoScrollController` in the surah selector.
- Automatically scrolls to the current surah.

* fix formatting

---------

Co-authored-by: Yassin <[email protected]>
* center mosque information widget

* format code

* remove expanded widget with flash message

* refactor(footer): for improved readability and maintainability

- Organized imports for clarity.
- Simplified widget structure and logic.
- Enhanced variable naming for better understanding.
- Improved layout responsiveness with consistent sizing.
- Reduced nested conditionals for cleaner code.

* fix: formatting

* fix: positing of logo and icon

* fix: centering the info at the mosque

* formatting

---------

Co-authored-by: Yassin <[email protected]>
…separate the logic from the ui

- Introduced a debounce mechanism for search query handling in `ReciteNotifier` to optimize reciter filtering.
- Added filtered reciters and favorite reciters to the `ReciteState` for handling search results.
- Updated `reciter_selection_screen.dart` to reflect changes in search query handling and debounce implementation.
- Refactored UI elements in `reciter_selection_screen.dart` to work with filtered reciters.
- Removed unused search-related focus node code to clean up the UI logic.
- Removed unused imports and initial focus index from `ReciterListView`.
- Refactored `ReciterSelectionScreen` for better readability and structure.
- Simplified tab bar implementation by removing redundant `PreferredSize`.
- Introduced helper methods to clean up widget building logic.
- Improved shimmer effect UI for loading reciters in both light and dark modes.
- Enhanced search functionality with proper focus handling for empty results.
- Updated reciter list and recite type grid view components for cleaner focus management."
@ghassenbenzahra123 ghassenbenzahra123 merged commit 8a06f46 into main Oct 14, 2024
1 check passed
@ghassenbenzahra123 ghassenbenzahra123 deleted the feat/dynamic-search-reciter branch October 14, 2024 15:34
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.

Quran features 3
2 participants