- Trending Movies
- Top Rated movies
- Upcomming Movies
- Popular TV shows
- Top TV shows
- Search Movies by name
- Flutter
- MovieDB API
- Youtube API
- VS-Code
- Postman
- Create urls.dart file inside urls folder.
- Create a class as follows
import 'package:flutter/cupertino.dart';
class MovieDB {
static String moviedb_trending_movie_url =
'https://api.themoviedb.org/3/trending/movie/week?api_key={Your API key}';
static String moviedb_top_rated_movie_url =
'https://api.themoviedb.org/3/movie/top_rated?api_key={Your API key}';
static String moviedb_popular_movie_url =
'https://api.themoviedb.org/3/movie/popular?api_key={Your API key}';
static String moviedb_upcomming_movie_url =
'https://api.themoviedb.org/3/movie/upcoming?api_key={Your API key}';
static String moviedb_popular_tvshows_url =
'https://api.themoviedb.org/3/tv/popular?api_key={Your API key}';
static String moviedb_top_rated_tvshows_url =
'https://api.themoviedb.org/3/tv/top_rated?api_key={Your API key}';
static String moviedb_latest_tvshows_url =
'https://api.themoviedb.org/3/tv/latest?api_key={Your API key}';
static searchMovieDB(String query) {
String moviedb_search_movie_url =
'https://api.themoviedb.org/3/search/movie?api_key={Your API key}&query=${query}';
return moviedb_search_movie_url;
}
}
class YouTube {
static String youtube_API_key = "{Youtube API key}";
static setUrl(String movieName) {
String youtube_video_data_url =
'https://www.googleapis.com/youtube/v3/search?key=${youtube_API_key}&q=${movieName} movie official trailer &maxResults=1&order=relevance';
return youtube_video_data_url;
}
}