BeatNest is a cross-platform music streaming app built with Flutter. It streams tracks from the Saavn API and focuses on the things that actually make a music player feel good: gapless background playback , media-style notifications, lock-screen controls and offline listening.
Why Flutter
One codebase, two stores. Flutter let me ship a consistent UI on Android and iOS while still dropping down to native APIs where it mattered — the media session, notifications and storage permissions.
Architecture
The app follows a clean, service-oriented structure so the UI stays dumb and the logic stays testable:
- ApiService — talks to the Saavn API for search and trending songs.
- MusicService — the playback brain: queue, current track, play/pause/seek, exposed as reactive streams with rxdart.
- AudioHandler — the background audio service that survives the app being backgrounded.
Background playback
This is where most music apps fall apart. BeatNest combines just_audio for the player with audio_service for the OS-level media session. That gives you a notification with controls, lock-screen artwork, and playback that keeps going when the app is swiped away.
dependencies:
just_audio: ^0.10.5
audio_service: ^0.18.12
audio_session: ^0.2.3
rxdart: ^0.28.0
Auth and cloud sync
Users can continue as a guest or sign in with email or Google via Firebase Auth. Signing in syncs their liked songs and playlists across devices through Cloud Firestore, so the library follows the user, not the phone.
Offline and resilience
Downloads use dio with a local SQLite index so songs are available without a connection, and connectivity_plus gracefully degrades the UI when the network drops. Crashes and usage are tracked with Firebase Crashlytics and Analytics.
Lessons learned
- Treat the audio session as the source of truth — the UI should reflect it, never drive it directly.
- Background execution rules differ a lot between Android and iOS; test on real devices early.
- A "Continue as guest" path removes friction and still lets you upsell sync later.
BeatNest started as an experiment in "can Flutter really do a proper media app?" The answer turned out to be a confident yes.
Top comments (0)