Last active
March 31, 2019 04:15
-
-
Save maffan91/34dcfc67bd7a380624b9ea9fd848828a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ListView.builder( | |
itemCount: movies.length, | |
itemBuilder: (BuildContext context, int index) { | |
return Dismissible( | |
onDismissed: (DismissDirection direction) { | |
if (direction == DismissDirection.endToStart) { | |
setState(() { | |
movies.removeAt(index); | |
}); | |
} | |
}, | |
secondaryBackground: Container( | |
child: Center( | |
child: Text( | |
'Delete', | |
style: TextStyle(color: Colors.white), | |
), | |
), | |
color: Colors.red, | |
), | |
background: Container(), | |
child: MovieCard(movie: movies[index]), | |
key: UniqueKey(), | |
); | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment