GithubHelp home page GithubHelp logo

dsbferris / tmdb_movie_app_riverpod Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bizz84/tmdb_movie_app_riverpod

0.0 0.0 0.0 539 KB

Flutter Movies app with Riverpod (TMDB API)

Home Page: https://codewithandrea.com/

License: MIT License

Shell 0.14% Ruby 4.34% C++ 21.34% C 1.45% Objective-C 0.04% Kotlin 0.14% Dart 50.19% Swift 1.40% HTML 1.88% CMake 19.08%

tmdb_movie_app_riverpod's Introduction

Flutter Movies app with Riverpod (TMDB API)

This is an improved version of my old movies app based on the latest Riverpod 2.0 APIs.

Movies app preview

Motivation

I built this app to showcase the latest APIs for popular packages such as Riverpod and GoRouter.

This is not meant to be a complete movies app, yet it should implement common use cases and features. ๐Ÿ‘‡

Current Features

  • Infinite scrolling with pagination
  • Pull to refresh
  • Search functionality
  • Loading UI with the Shimmer package
  • Stateful nested routing with StatefulShellRoute

Here's a detailed tutorial explaining how the pagination and search UI works:

Planned Features (no promises ๐Ÿ˜…)

  • Favourites
  • Responsive UI

Packages in use

App Architecture & Folder structure

The project follows my Riverpod app architecture with a feature-first project structure.

More details here:

It also uses the new Riverpod Generator package, which I have covered here:

Getting a TMDB API key

This project uses the TMDB API to get the latest movies data.

Before running the app you need to sign up on the TMDB website, then obtain an API key on the settings API page.

Once you have this, create an .env file at the root of the project and add your key:

// .env
TMDB_KEY=your-api-key

Then, run the code generator:

dart pub run build_runner build -d

This will generate a env.g.dart file inside lib/env. This contains the tmdbApiKey that is used when making requests to the TMDB API.

Congratulations, you're good to go. ๐Ÿ˜Ž

Note: Loading images from insecure HTTP endpoints

The data returned by the TMBD API points to image URLs using http rather than https. In order for images to load correctly, the following changes have been made:

Android

Created a file at android/app/src/main/res/xml/network_security_config.xml with these contents:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>

Added this to the application tag in the AndroidManifest.xml:

android:networkSecurityConfig="@xml/network_security_config"

iOS

Add the following to ios/Runner/info.pList:

  <key>NSAppTransportSecurity</key>
  <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
  </dict>

More information here:

macOS

Since macOS applications are sandboxed by default, we get a SocketException if we haven't added the required entitlements. This has been fixes by adding these lines to macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements:

<key>com.apple.security.network.client</key>
<true/>

More info here:

tmdb_movie_app_riverpod's People

Contributors

bizz84 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.