Created
March 17, 2021 21:40
-
-
Save manoellribeiro/cfaa9321dc6080ef05cb6201abe32fa5 to your computer and use it in GitHub Desktop.
Daniel - Segundo Encontro
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
void main() { | |
// forEach | |
void mudarOStatusDeTodosOsFilmes(List<MovieInfo> list) { | |
} | |
// map | |
List<String> criarUmaListaComNomeDosFilmes(List<MovieInfo> list) { | |
} | |
// where | |
List<MovieInfo> filtrarPorStatus(List<MovieInfo> list, MovieStatus status) { | |
return []; | |
} | |
print(filtrarPorStatus(moviesList, MovieStatus.completed)); | |
} | |
enum MovieStatus { | |
recentlyReleased, | |
completed, | |
inProgress, | |
waitingForRelease, | |
} | |
class MovieInfo { | |
int id; | |
String name; | |
MovieStatus status; | |
MovieInfo({ | |
required this.id, | |
required this.name, | |
required this.status, | |
}); | |
} | |
final moviesList = [ | |
MovieInfo( | |
id: 0, | |
name: "Mulan", | |
status: MovieStatus.completed, | |
), | |
MovieInfo( | |
id: 2, | |
name: "Parasita", | |
status: MovieStatus.completed, | |
), | |
MovieInfo( | |
id: 3, | |
name: "Wheathering with you", | |
status: MovieStatus.completed, | |
), | |
MovieInfo( | |
id: 4, | |
name: "Soul", | |
status: MovieStatus.recentlyReleased, | |
), | |
MovieInfo( | |
id: 5, | |
name: "Raya e o último dragão", | |
status: MovieStatus.waitingForRelease, | |
), | |
MovieInfo( | |
id: 6, | |
name: "Justice League - Snyder Cut", | |
status: MovieStatus.waitingForRelease, | |
), | |
]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment