-
Notifications
You must be signed in to change notification settings - Fork 17
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: Add Switching Between Quran Warsh and Hafs #1328
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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.
- 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.
- 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`.
YassinNouh21
changed the title
Feat/quran/switch moshaf
feat: Add Switching Between Quran Warsh and Hafs
Sep 21, 2024
- Refactor DownloadQuranRemoteDataSource to initialize cancelToken properly - Add checks to prevent updating progress after cancellation - Implement _isCancelled flag in DownloadQuranNotifier to manage cancellation state - Ensure download cancellation is properly handled throughout the download process
…wnload method - Updated cancelDownload method to accept a CancelToken. - Enhanced download handling to ensure proper cancellation of ongoing downloads. - Improved cleanup logic upon cancellation to remove downloaded files.
- Introduced `CancelDownloadException` to manage download cancellations gracefully. - Updated `download_quran_popup.dart` to display an empty container when a download is canceled. - Enhanced error handling in `download_quran_remote_data_source.dart` to throw `CancelDownloadException` on cancellation. - Modified `download_quran_notifier.dart` to prevent state updates when a `CancelDownloadException` is caught, ensuring a smoother user experience. - Updated unit tests in `download_quran_remote_data_source_test.dart` to verify that cancellation throws the new `CancelDownloadException`. This change improves the app's responsiveness and user feedback during the Quran download process by clearly handling cancellation scenarios.
YassinNouh21
force-pushed
the
feat/quran/switch_moshaf
branch
from
October 5, 2024 17:25
2477b01
to
bb622a0
Compare
ghassenbenzahra123
approved these changes
Oct 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Add Feature for Switching Between Quran Warsh and Hafs
Overview
This PR introduces functionality to switch between two versions of the Quran: Warsh and Hafs. The feature enhances user experience by allowing readers to select their preferred recitation style easily.
Changes Made
New Features
MoshafSelector
) that allows users to switch between the two recitations.MoshafTypeNotifier
to manage the selected recitation type and its associated state.Code Changes
Testing