Overview
Aradia Audiobooks is built using Flutter with a clean architecture that separates concerns using the BLoC pattern for state management and Provider for dependency injection. The app follows best practices for scalable mobile applications.Technology Stack
Flutter Framework
Cross-platform mobile framework for Android and iOS
BLoC Pattern
Business Logic Component pattern for state management
Provider
Dependency injection and state propagation
GoRouter
Declarative routing and navigation
Project Structure
The codebase is organized into logical layers:Core Architectural Patterns
BLoC Pattern
Aradia uses the BLoC (Business Logic Component) pattern to separate presentation from business logic. Each major screen has its own BLoC:Provider for Dependency Injection
Provider manages global state and services. Key providers include:GoRouter Navigation
Declarative routing with nested navigation and state preservation:Hive for Local Storage
Hive provides fast, lightweight local storage for offline data:Data Models
The app uses well-structured data models for type safety:Audio Service Integration
Aradia integrates with Android’s audio service for background playback and media controls:- Audio Service: Manages background audio playback
- Just Audio: High-performance audio player
- Media Notifications: System-level playback controls
- ChromeCast: Cast audio to ChromeCast devices
The audio service is initialized after the first frame to ensure the UI loads immediately without blocking.
Key Design Decisions
Why BLoC Pattern?
Why BLoC Pattern?
BLoC provides:
- Clear separation between UI and business logic
- Testable code with predictable state changes
- Easy debugging with state transitions
- Reactive programming with streams
Why Provider + BLoC?
Why Provider + BLoC?
Provider handles global services (audio, theme, settings) while BLoC manages screen-specific business logic. This hybrid approach gives the best of both worlds.
Why GoRouter?
Why GoRouter?
GoRouter provides:
- Declarative routing configuration
- Deep linking support
- Nested navigation with state preservation
- Type-safe route parameters
Why Hive?
Why Hive?
Hive is:
- Fast and lightweight
- No native dependencies
- Type-safe with code generation
- Perfect for storing favorites, history, and settings
Next Steps
Building from Source
Set up your development environment
State Management
Deep dive into BLoC and Provider usage
Contributing
Learn how to contribute to the project