movie_database_client 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

Movie Database Client #

Dart client wrapping http://www.omdbapi.com/ to search movies.

Getting Started #

To run or use this package you'll need to first get an API key from http://omdbapi.com.

Then you can call the API like this:

final client = new MovieDatabaseClient('your key');
const results = await client.search('some title');

Running tests #

Dart CI

The tests require having an API key to use as well.

Copy the test/settings.example.json to test/settings.json and update the key in their with your own key.

[1.0.3] #

  • Formatting.

[1.0.2] #

  • Added an example.

[1.0.1] #

  • Refactoring.

[1.0.0] #

  • Functional version of the library.

example/main.dart

import 'dart:async';

import 'package:movie_database_client/movie_database_client.dart';
import 'package:movie_database_client/title_match.dart';

Future<int> main(List<String> args) async {
  if (args.length != 2) {
    print("Usage: pub run main.dart <apiKey> <search>");
    return 1;
  }
  final apiKey = args[0];
  final search = args[1];

  final client = new MovieDatabaseClient(apiKey);
  final result = await client.search(search);

  if (result.isEmpty) {
    print("No matches.");
  } else {
    result.forEach(printMatch);
  }

  return 0;
}

void printMatch(TitleMatch match) {
  print("${match.type}: ${match.title}");
}

Use this package as a library

1. Depend on it

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


dependencies:
  movie_database_client: ^1.0.3

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:movie_database_client/movie_database_client.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
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]
60
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.15

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 1.15.0-nullsafety
http_parser 3.1.4
meta 1.2.2 1.3.0-nullsafety
path 1.7.0
pedantic 1.9.2
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
Dev dependencies
test any