sam-nixplay / movies

🎬 Movies: Flutter magic with TheMovieDB API - BLoC, Retrofit, and more in one sleek app. 🍿
0 stars 2 forks source link

Movies App (Flutter)

A Flutter project that fetches movies from TheMovieDB using Flutter BLoC for state management, Retrofit as a REST client, and Freezed for code generation. The app also employs go_router for navigation and uses Patrol and Mocktail for testing.

Table of Contents

  1. Getting Started
  2. Usage
  3. Testing
  4. Dependencies
  5. Contributing
  6. License
  7. Acknowledgments

Getting Started

Prerequisites

Installation

  1. Install FVM (Flutter Version Management)

    FVM helps manage multiple Flutter SDK versions and allows for pinning a version per project.

    First, ensure you have Dart installed on your machine. If not, follow the official Dart installation guide.

    With Dart installed, you can install FVM:

    dart pub global activate fvm

    Ensure that the path ~/.pub-cache/bin is in your system's PATH so that you can run fvm from any terminal window.

  2. Clone the repository

    git clone https://github.com/sam-nixplay/movies.git
    cd movies
  3. Install Flutter using FVM

    fvm install 3.10.5
  4. Switch to the Flutter version for this project (if you have multiple Flutter versions)

    fvm global 3.10.5
  5. Get dependencies

    flutter pub get
  6. Setting up API Token

    The app expects an API token from TheMovieDB to be available in the starting variables when running the flutter app. Modify the launch.json file (in using VS Code) or set local environment variable and add your API token as follows:

    --dart-define=API_TOKEN=YOUR_API_TOKEN

    or

      {
         "name": "movies",
         "request": "launch",
         "type": "dart",
         "args": [
               "--dart-define", "API_TOKEN=YOUR_API_TOKEN",
         ],
      },

Usage

  1. Run the app
    flutter run --dart-define=API_TOKEN=YOUR_API_TOKEN

Testing

  1. Run tests
    flutter test --dart-define=API_TOKEN=YOUR_API_TOKEN

Dependencies

Contributing

If you want to contribute to this project, please fork the repository, create your feature branch, commit your changes, and open a PR against the main branch.

License

This project is under the MIT License. See LICENSE.md for more details.

Acknowledgments


Remember to replace placeholders like your-repo-link with appropriate values before pushing this README or sharing with others. Also, ensure the .env file is added to your .gitignore to avoid accidentally pushing your API token.