tmdb_dart 0.0.6 copy "tmdb_dart: ^0.0.6" to clipboard
tmdb_dart: ^0.0.6 copied to clipboard

outdated

Type Safe API client for TheMovieDB

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 = new TmdbService(arguments[0]);
  await service.initConfiguration();

  var pagedResult = await service.searchMovies("harry");

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

  var popular = await service.getPopularMovies(new MovieSearchSettings());

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

  var movie = await service.getMovie(671,
      appendSettings: MovieAppendSettings(
          includeRecommendations: true, includeSimilarMovies: true));

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

// 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 = new Iterable.generate(100)
      .map((x) => service.searchMovies(x.toString()))
      .toList();
  await Future.wait(futures);
}
13
likes
0
pub points
59%
popularity

Publisher

unverified uploader

Type Safe API client for TheMovieDB

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on tmdb_dart