Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class OmdbRepository {
final apiKey = "my_key";
const OmdbRepository();
Future<List<Movie>> searchMovies(String byName) async {
final response = await http.get('$byName&apikey=$apiKey');
final jsonValue = json.decode(response.body);
return SearchResponse.fromJson(jsonValue).movies;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment