A TheMovieDatabase client library for dart. To know more about TMDB visit offical site
Supports all the functions of version 3 of tmdb API
- Auth
- Account
- Guest Sessions
- Movies
- Tv shows
- Tv Seasons
- Tv Episodes
- People
- Credits
- Certification
- Changes
- Collections
- Find
- Genres
- Keywords
- Companies
- Trending
- Search
- Discover
- Networks
- Reviews
- Versions
- Lists
- Image URL Constructor
- auth
- account
- lists
(updated on v1.2.4)
Add this to your package's pubspec.yaml file:
dependencies:
tmdb_api: ^1.2.4 //visit tmdb for latest version number
Now in your Dart code, you can use:
import 'package:tmdb_api/tmdb_api.dart';
Now you need to create instance for TMDB
and ApiKeys
with your api keys.
TMDB tmdbWithCustomLogs = TMDB( //TMDB instance
ApiKeys('Your API KEY', 'apiReadAccessTokenv4'),//ApiKeys instance with your keys,
);
There are 3 logconfigs presets avaliable.
ConfigLogger.showAll()
: development use.ConfigLogger.showRecommended()
: development use.ConfigLogger.showNone()
: production use.
You can add any off this presets to logConfig
named parameter of TMDB
instance
Custom Logs
TMDB tmdbWithCustomLogs = TMDB(
ApiKeys('Your API KEY', 'apiReadAccessTokenv4'),
logConfig: ConfigLogger(
showLogs: true,//must be true than only all other logs will be shown
showErrorLogs: true,
),
);
For getting Trending movies
Map result = await tmdb.v3.trending.getTrending(mediaType = MediaType.all,timeWindow = TimeWindow.day);