Created
March 1, 2024 08:39
-
-
Save jxstxn1/dae14e5bc9397e739c466effdc0f8bf6 to your computer and use it in GitHub Desktop.
Pattern Matching
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
void main() { | |
final Map<String, dynamic> json = { | |
"adult": false, | |
"backdrop_path": '/8Y43POKjjKDGI9MH89NW0NAzzp8.jpg', | |
"genre_ids": [28, 12, 14, 878], | |
"id": 140607, | |
"release_date": '2015-12-18', | |
}; | |
final { | |
'adult': bool adult, | |
'backdrop_path': String backdropPath, | |
'genre_ids': List<int> genreIds, | |
'id': int id, | |
'release_date': String releaseDate, | |
} = json; | |
print(genreIds); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment