Last active
December 11, 2018 09:53
-
-
Save florent37/d70ca900f2f97c58aa501f223c0bc754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OmdbRepository { | |
final apiKey = "my_key"; | |
const OmdbRepository(); | |
Future<List<Movie>> searchMovies(String byName) async { | |
final response = await http.get('http://www.omdbapi.com/?s=$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