How mptwaktusolat/app_waktu_solat_malaysia works
Project Overview & Purpose
• This is a full-stack mobile application built with Flutter that displays prayer times for various locations in Malaysia. It also integrates features like feedback submission, updates checking, location determination, and a Qibla/Kompas Kiblat module.
• The app relies on a mix of internal Flutter features (UI, business logic, state management) and external APIs (e.g., Waktu Solat App API, other backup prayer time APIs).
Main Architectural Components
a. UI / Presentation Layer:
• Flutter views and widgets contained in the “lib/views” directory. Group related UI pages/components (e.g., Home Page, Settings, Onboarding, Feedback, Kompas Kiblat, and Prayer Time views).
• Modular separation in screens to follow the principle of separation of concerns.
b. Business Logic & State Management:
• “lib/providers” folder which hosts various providers (Locale, Location, Setting, Timetable, Updater). These handle state management and business logic.
• Feature-specific services and controllers (such as update_checker_service for check updates and feedback_submission_service for feedback).
• Directional data flow from these providers into the UI layer.
c. Data & Integration Layer:
• Detail the “lib/networking” folder, which contains API communication logic (e.g., mpt_fetch_api.dart). This connects the app to external prayer time APIs.
• “lib/models” and JSON parsing utilities as part of the data model layer.
• “lib/location_utils” as a module that supports geolocation and location data fetching.
d. Feature Modules:
• Check Updates: Show its models, services, and views, noting its responsibilities for ensuring app version compatibility.
• Feedback: Separate component handling feedback submission.
• Kompas Kiblat: Module for Qibla calculation and sensor integration, including error widgets for device limitations.
e. Asset and Resource Layer:
• “assets” folder (images, fonts, json) which supports the UI.
f. Native & Platform Integration:
• Android-specific components (native integration, Gradle build scripts, and AndroidManifest files from the “android” folder).
• This layer is responsible for platform-specific functionality like scheduling notifications, handling permissions (e.g., alarm/notification permissions), and interfacing with device-level services.
g. External APIs & Services:
• Waktu Solat App API (primary API)
• Other backup prayer time APIs (AzanPro, E-solat JAKIM, etc.)
• Firebase (for push notifications, analytics, if applicable)
Relationships & Interactions
• From the UI components to Providers (for user actions).
• From Providers/services to the networking layer (for API calls).
• Between native Android module and Flutter for platform-specific functionality.