Created
December 9, 2019 20:00
-
-
Save azamsharp/7822c96892a3a7ee924373e4eadc7fb3 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 MovieListViewModel extends ChangeNotifier { | |
List<MovieViewModel> movies = List<MovieViewModel>(); | |
Future<void> fetchMovies(String keyword) async { | |
final results = await Webservice().fetchMovies(keyword); | |
this.movies = results.map((item) => MovieViewModel(movie: item)).toList(); | |
print(this.movies); | |
notifyListeners(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment