Skip to content

Instantly share code, notes, and snippets.

@manoellribeiro
Created March 17, 2021 21:40
Show Gist options
  • Save manoellribeiro/cfaa9321dc6080ef05cb6201abe32fa5 to your computer and use it in GitHub Desktop.
Save manoellribeiro/cfaa9321dc6080ef05cb6201abe32fa5 to your computer and use it in GitHub Desktop.
Daniel - Segundo Encontro
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