A modern Flutter application for browsing and discovering movies, built with clean architecture principles and state-of-the-art Flutter packages.
- Features
- Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Project Structure
- Running the App
- Building for Production
- Contributing
- License
- π₯ Browse popular movies
- π Search for movies
- π± Responsive UI design
- π¨ Modern Material Design
- π State management with Riverpod
- π API integration with The Movie Database (TMDB)
- π Smooth animations
- π Clean architecture implementation
This project follows Clean Architecture principles with a clear separation of concerns:
lib/
βββ config/ # App configuration (theme, routing, constants)
βββ domain/ # Business logic layer
β βββ entities/ # Business entities
β βββ repositories/# Repository interfaces
β βββ datasources/ # Datasource interfaces
βββ infrastructure/ # Data layer
β βββ datasources/ # API implementations
β βββ models/ # Data models
β βββ mappers/ # Entity-Model mappers
β βββ repositories/# Repository implementations
βββ presentation/ # UI layer
βββ screens/ # App screens
βββ widgets/ # Reusable widgets
βββ providers/ # Riverpod providers
- Domain Layer: Contains business logic, entities, and repository interfaces
- Infrastructure Layer: Implements data sources, API calls, and repositories
- Presentation Layer: UI components, screens, and state management
- Flutter SDK: ^3.9.2
- Dart SDK: ^3.9.2
- flutter_riverpod: ^3.0.1 - Reactive state management
- go_router: ^16.2.4 - Declarative routing
- dio: ^5.9.0 - HTTP client for API calls
- card_swiper: ^3.0.1 - Card swiper widget
- animate_do: ^4.2.0 - Animation library
- flutter_dotenv: ^6.0.0 - Environment configuration
- intl: ^0.20.2 - Internationalization and formatting
- flutter_lints: ^5.0.0 - Linting rules
- flutter_test: Testing framework
Before you begin, ensure you have the following installed:
- Flutter SDK (version 3.9.2 or higher)
- Dart SDK (version 3.9.2 or higher)
- Android Studio or Xcode (for mobile development)
- Visual Studio Code (recommended) or any preferred IDE
- A TMDB API Key (free registration required)
-
Clone the repository
git clone <repository-url> cd movies_app
-
Install dependencies
flutter pub get
-
Verify Flutter installation
flutter doctor
Make sure all required dependencies are installed and configured.
-
Copy the environment template
cp .env.template .env
-
Configure your API credentials
Open the
.envfile and add your TMDB API credentials:THE_MOVIE_DB_KEY=your_api_key_here API_TOKEN=your_api_token_here URL_BASE_MOVIE=https://api.themoviedb.org/3
-
Get TMDB API Credentials
- Visit The Movie Database
- Create a free account
- Go to Settings β API
- Request an API key
- Copy your API Key and API Read Access Token
- Paste them into your
.envfile
β οΈ Important: Never commit your.envfile to version control. It's already included in.gitignore.
movies_app/
βββ android/ # Android native code
βββ ios/ # iOS native code
βββ linux/ # Linux native code
βββ macos/ # macOS native code
βββ lib/ # Main application code
β βββ config/
β β βββ constants/ # App constants
β β βββ helpers/ # Helper functions
β β βββ router/ # Navigation configuration
β β βββ theme/ # App theme
β βββ domain/
β β βββ datasources/ # Data source interfaces
β β βββ entities/ # Business entities
β β βββ repositories/ # Repository interfaces
β βββ infrastructure/
β β βββ datasources/ # API implementations
β β βββ mappers/ # Data mappers
β β βββ models/ # Data models
β β βββ repositories/ # Repository implementations
β βββ presentation/
β β βββ providers/ # Riverpod providers
β β βββ screens/ # App screens
β β βββ widgets/ # Reusable widgets
β βββ main.dart # App entry point
βββ .env.template # Environment variables template
βββ .env # Environment variables (create this)
βββ pubspec.yaml # Dependencies configuration
βββ README.md # This file
Run the app in debug mode:
flutter runRun on a specific device:
# List available devices
flutter devices
# Run on specific device
flutter run -d <device-id>While the app is running, you can use:
- Press
rto hot reload - Press
Rto hot restart - Press
qto quit
# Build APK
flutter build apk --release
# Build App Bundle (recommended for Play Store)
flutter build appbundle --release# Build for iOS
flutter build ios --releaseflutter build linux --releaseflutter build macos --releaseRun all tests:
flutter testRun tests with coverage:
flutter test --coverageEnable Flutter DevTools:
flutter pub global activate devtools
flutter pub global run devtoolsThis project follows the official Flutter style guide and uses flutter_lints for code analysis.
Run the linter:
flutter analyzeFormat code:
flutter format .Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- The Movie Database (TMDB) for providing the movie data API
- Flutter team for the amazing framework
- All contributors and package maintainers
If you have any questions or need help, please:
- Open an issue in the repository
- Check the Flutter documentation
- Visit TMDB API documentation
Made with β€οΈ using Flutter