This PR introduces several enhancements and fixes related to the Random Hadith feature in the application. Key changes include fixing import issues in RandomHadithScreen, implementation of a Riverpod notifier for random hadith, and additions to the repository and data source layers for handling random hadiths.
This PR is for issue: #994
Description
Implemented automatic triggering of random hadith fetching at the initialization of normal_workflow and RandomHadithScreen to provide users with immediate access to hadiths.
Added a Riverpod notifier for random hadith, enabling state management for this feature and ensuring a reactive UI update when hadiths are fetched.
Expanded the data handling architecture with the addition of repository and data source implementations for random hadiths, including both remote and local data sources.
Introduced RandomHadithConstant within the constants file to manage keys used across the feature, enhancing code maintainability.
Initialized Hive in the main application file to support local data storage for the random hadith feature.
Customized Dio with a custom interceptor to tailor network requests for the random hadith feature, including error handling and logging.
Performance Enhancement: By utilizing multi-threading through Dart's Isolate, this PR significantly improves the performance of fetching and parsing hadiths, avoiding UI thread blocking at the application's start.
New Functionality: Ensures that a hadith is fetched at each start of the app and refreshed every day, increasing the synchronization and ensuring that the content is up-to-date.
Checklist:
[x] Coding Standards: I have reviewed my code to ensure it follows the project's coding standards.
[x] Testing: I have tested the changes and they work as expected. The random hadith feature fetches and displays hadiths as intended, with proper handling of connectivity changes and data caching.
[x] Merge Conflicts: I have resolved any merge conflicts with the latest main/development branch.
[x] Branch Status: The branch is up-to-date with the target branch (main/development).
📝 Summary
This PR introduces several enhancements and fixes related to the Random Hadith feature in the application. Key changes include fixing import issues in
RandomHadithScreen
, implementation of a Riverpod notifier for random hadith, and additions to the repository and data source layers for handling random hadiths.This PR is for issue: #994
Description
normal_workflow
andRandomHadithScreen
to provide users with immediate access to hadiths.RandomHadithConstant
within the constants file to manage keys used across the feature, enhancing code maintainability.Checklist: