tmdb_dart 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

Dart TMDB #

The Movie DB API Client for Dart v2

Issues #

For issues, file directly in the main repo.

0.0.1 #

  • Initial release.

0.0.1+1 #

  • Renamed main lib file according to pub guidelines
  • Relaxed constraint on http dependency

0.0.2 #

  • Added methods for predefined searches: getTopRatedMovies(), getPopularMovies(), getUpcomingMovies(), getNowPlayingMovies(), getLatestMovies()

0.0.3 #

  • Added methods for getting movie details getMovie()
  • Partial support for response appending of getMovie(), currently only Images are appended
  • Renamed Resolution to AssetQuality
  • Extracted Asset Path resolving methods from Configuration class to AssetResolver

0.0.4 #

  • Changed http package version

0.0.5 #

  • Upgraded version of the 'http' package
  • Upgraded sdk version to stable (was 'dev' previosly)
  • Enhanced getMovie() method to support new appending options
    1. Alternative Titles
    2. Credits
    3. External Ids
    4. Keywords
    5. Videos
    6. Recommendations
    7. Similar Movies

0.0.6 #

  • Asset Resolver now resolves null urls to null instead of prepending image url
  • MovieBase constructor does not fail anymore on null release date

0.0.7 #

  • Fix for null properties in serialized movie search settings

0.0.8 #

  • Fix code style according to dartfmt
  • Rename Image to ImageInfo for better import resolution when used with flutter

0.0.9 #

  • Akash Mondal - Fix typo in MovieBase constructor causing exceptions when accesing movie genres

0.0.10 #

  • Akash Mondal - Fix Exception:ArgumentError while parsing release_date at MovieBase.fromJson() constructor
  • Akash Mondal - Remove unnecessary new keywords and Re-format some code
  • Akash Mondal - Fix warnings due to unused variables and Improve some codes
  • Akash Mondal - Add assertion to parameters of TmdbService, Configuration constructors

0.0.11 #

  • Akash Mondal - Add a seperate quality Original to AssetQuality
  • Akash Mondal - Change all Movie Settings constructors to const
  • Akash Mondal - Add new classes SortBy and Date for movie discover
  • Akash Mondal - Add new movie service functions.
    1. discoverMovies()
    2. getAllMovieGenres()
    3. getAllCountries()

0.1.0 #

  • Akash Mondal - Implement most of TV Shows API functions.
    1. Search
    2. Discover
    3. Top Rated
    4. Popular
    5. Airing Today
    6. On The Air
    7. Latest
    8. Show Details
    9. Season Details
    10. Episode Details
  • Akash Mondal - Now movie and tv show related queries can be done using the tmdbService.movie and tmdbService.tv instance respectively.
  • Akash Mondal - Change all apiKey instance variables to final, it should be the same everywhere throughout an instance of TmdbService.

0.1.1 #

  • Akash Mondal - Implement getVideos() for movie & tv show, season, episode
  • Akash Mondal - Expose variable page to function parameters
  • Akash Mondal - Implement getImages() for movie & tv show, season, episode
  • Akash Mondal - Remove all explicit initialization of default values to optional query parameters

example/main.dart

import 'dart:async';
import 'package:tmdb_dart/tmdb_dart.dart';

Future main(List<String> arguments) async {
  assert(arguments.length == 1);
  TmdbService service = TmdbService(arguments[0]);

  // auto configure api based on default configuration
  // OR custom configure api using setter 'configuration'
  await service.initConfiguration();

  var pagedResult = await service.movie.search("harry");

  for (var movie in pagedResult.results) {
    print("${movie.title} - ${movie.voteAverage}");
  }

  var pagedTvResult = await service.tv.getAiringToday();

  for (var tv in pagedTvResult.results) {
    print("${tv.name} - ${tv.voteAverage}");
  }

  var popular = await service.movie.getPopular();

  for (var movie in popular.results) {
    print("${movie.title} - ${movie.voteAverage}");
  }

  var discover = await service.movie.discover(
    settings: MovieDiscoverSettings(
      primaryReleaseDateGTE: Date(day: 15, month: 9, year: 2010),
      primaryReleaseDateLTE: Date(day: 22, month: 10, year: 2015),
      voteAverageGTE: 5.5,
      withPeople: [108916, 7467],
      sortBy: SortBy.popularity.desc,
      quality: QualitySettings(
        backdropQuality: AssetQuality.High,
        logoQuality: AssetQuality.High,
        posterQuality: AssetQuality.High,
        profileQuality: AssetQuality.High,
        stillQuality: AssetQuality.High,
      ),
    ),
  );

  for (var movie in discover.results) {
    print("${movie.title} - ${movie.voteAverage} - ${movie.releaseDate}");
  }

  var movie = await service.movie.getDetails(671,
      appendSettings: AppendSettings(
        includeRecommendations: true,
        includeSimilarContent: true,
      ));

  print("${movie.recommendations[0].title}");
  print("${movie.similar[0].title}");

  var tv = await service.tv.getDetails(1399,
      appendSettings: AppendSettings(
        includeRecommendations: true,
        includeSimilarContent: true,
      ));
  print("${tv.originalName} - ${tv.seasons.length}");
  print("${tv.similar[0].originalName} - ${tv.similar[0].firstAirDate}");

  print("Countries: ${(await service.getAllCountries()).length}");
  print("MovieGenres: ${(await service.getAllTvGenres()).length}");
}

// generate many requests
// number of requests is over the allowed threshold
// but thanks to integrated resilience, all the requests are completed successfully
Future resilienceExample(TmdbService service) async {
  var futures = Iterable.generate(100)
      .map((x) => service.movie.search(x.toString()))
      .toList();
  await Future.wait(futures);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  tmdb_dart: ^0.1.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:tmdb_dart/tmdb_dart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1

Health issues and suggestions

Document public APIs. (-0.20 points)

392 out of 403 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+4 0.12.1
Transitive dependencies
charcode 1.1.3
collection 1.14.13
http_parser 3.1.4
meta 1.1.8 1.2.0
path 1.7.0
pedantic 1.9.0 1.9.1
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0