Created
December 14, 2019 16:48
-
-
Save rrifafauzikomara/0fd5520e8cddb4cd4a571a6e0252c79e 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
Widget showListMovie(AsyncSnapshot<Movie> snapshot) { | |
return ListView.builder( | |
itemCount: snapshot == null ? 0 : snapshot.data.results.length, | |
itemBuilder: (BuildContext context, int index) { | |
return GestureDetector( | |
child: CardListMovies( | |
image: 'https://image.tmdb.org/t/p/w185${snapshot.data.results[index].posterPath}', | |
title: snapshot.data.results[index].title, | |
vote: snapshot.data.results[index].voteAverage, | |
releaseDate: snapshot.data.results[index].releaseDate, | |
overview: snapshot.data.results[index].overview, | |
genre: snapshot.data.results[index].genreIds.take(3).map(buildGenreChip).toList(), | |
), | |
onTap: () { | |
Navigator.push( | |
context, | |
PageRouteBuilder( | |
transitionDuration: Duration(milliseconds: 777), | |
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) { | |
return DetailPage( | |
title: snapshot.data.results[index].title, | |
imagePoster: 'https://image.tmdb.org/t/p/w185${snapshot.data.results[index].posterPath}', | |
rating: double.parse(snapshot.data.results[index].voteAverage), | |
imageBanner: 'https://image.tmdb.org/t/p/original${snapshot.data.results[index].backdropPath}', | |
genre: snapshot.data.results[index].genreIds.take(3).map(buildGenreChip).toList(), | |
overview: snapshot.data.results[index].overview, | |
); | |
} | |
), | |
); | |
}, | |
); | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment