My Dua App
Flutter redesign of an existing Islamic app — consumes a live WordPress REST API for dua/dhikr content, schedules device-local adhan alarms per prayer time (geolocation-based), and streams audio via a persistent bottom-nav player.
A redesign of an existing “My Dua” Flutter application with a live WordPress custom REST API backend. The scope went beyond UI refresh: it added location-aware prayer time scheduling, device-local adhan alarms, Firebase observability, and an in-app audio player.
Content layer: WordPress REST API
The app fetches dua and dhikr content from mydua.online via a custom WordPress endpoint (/wp-json/customapi/v1). The ApiService class is generic — a single fetchData<T>() method that handles GET/POST, serializes JSON into typed Dart models via json_serializable, and logs requests and responses in debug mode.
All content is fetched over HTTP with a Bearer token for auth. The token is currently committed as a base64 literal in source — a known security gap; it should be in a build-time secret instead.
Prayer times and adhan alarms
This is the most technically interesting part. Prayer times (Fajr, Sunrise, Dhuhr, Asr, Maghrib) vary by location and date. The adhan Dart package implements the standard calculation algorithms (Muslim World League, North America, etc.) to compute exact times from GPS coordinates:
final prayerTimes = PrayerTimes.today(
Coordinates(latitude, longitude),
CalculationMethod.karachi.getParameters(),
);
For each prayer, setAdhanAlarm() schedules a device-local alarm using the alarm package:
final alarmSettings = AlarmSettings(
id: ++i,
dateTime: prayerTime,
assetAudioPath: 'assets/azzan.mp3',
loopAudio: false,
vibrate: true,
volume: 1.0,
fadeDuration: 3.0,
notificationTitle: '$prayerName Adhan',
androidFullScreenIntent: true, // breaks through do-not-disturb
);
await Alarm.set(alarmSettings: alarmSettings);
If the prayer time for today has already passed, the alarm is scheduled for tomorrow’s equivalent instead — preventing missed alarms when the app is opened mid-day.
Each alarm is toggle-able per prayer. SharedPreferences tracks the alarm_$id boolean, so users can disable individual prayers without losing the others.
Audio player
The app plays dua recordings via bottom_navbar_player — an audio player that persists in the bottom navigation bar across pages, similar to Spotify’s mini-player. The marquee package scrolls long track names in the player bar.
Firebase integration
- Analytics — tracks screen views and user events
- Crashlytics — catches unhandled exceptions with stack traces
- Remote Config — allows server-side feature flags without an app update (added in Apr 2024)
Stack
- Flutter 3 / Dart, Provider for state
adhan(prayer times),hijri(Islamic calendar),geolocatoralarm+flutter_local_notifications+permission_handlerwebview_flutterfor embedded web content,wakelockto keep screen on during audiodisable_battery_optimization— prompts user to exclude the app from battery saver so alarms fire reliably in the background
Timeline: Apr – May 2024