[Refactor] Remove PrayDataHandler and add PrayerTimeProvider and Services. #259
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.
This pull request refactors the way prayer times are managed and displayed in the app by introducing a dedicated provider and service for prayer time data. The changes improve state management, error handling, and UI responsiveness, and also update sharing functionality to use the new provider. The most important changes are grouped below:
Prayer Time State Management and Data Fetching
PrayerTimeProvider(lib/features/prayer_time/providers/prayer_time_provider.dart) that encapsulates prayer time state, loading, error handling, and exposes methods to fetch today's, monthly, and notification-relevant prayer times.PrayerTimeService(lib/features/prayer_time/services/prayer_time_service.dart) responsible for fetching, caching, and providing prayer time data, as well as updating the home screen widget.UI Refactoring and Integration
HomePage(lib/features/home/views/home_page.dart) to usePrayerTimeProviderfor loading and displaying prayer times, replacing the previousFutureBuilderandPrayDataHandlerlogic. Error and loading states now use provider state, and the prayer time list is rendered via the new widget. [1] [2] [3]PrayerTimeListWidget(lib/features/prayer_time/views/prayer_time_list_widget.dart) that displays today's prayer times, highlights the current prayer, and schedules notifications when appropriate.Sharing Functionality Updates
ShareTextBuilderandShareFloatingActionButtonto use prayer times fromPrayerTimeProviderinstead of the old handler, ensuring shared data is current and consistent with the app state. [1] [2] [3] [4] [5]…r and services.Update code to better segregrate UI and logic side.