Skip to content

Commit

Permalink
Update pkgs/flutter_http_example/lib/book.dart
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Bosch <[email protected]>
  • Loading branch information
brianquinlan and natebosch authored Nov 6, 2023
1 parent 264cb19 commit b0e23b5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pkgs/flutter_http_example/lib/book.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ class Book {

for (final item in items) {
if (item case {'volumeInfo': final volumeInfo as Map}) {
if (volumeInfo['title'] is String &&
volumeInfo['description'] is String &&
volumeInfo['imageLinks'] is Map &&
(volumeInfo['imageLinks'] as Map)['smallThumbnail'] is String) {
books.add(Book(
volumeInfo['title'] as String,
volumeInfo['description'] as String,
(volumeInfo['imageLinks'] as Map)['smallThumbnail'] as String));
if (volumeInfo
case {
'title': final String title,
'description': final String description,
'imageLinks': {'smallThumbnail': final String thumbnail}
}){
books.add(Book(title, description, thumbnail));
}
}
}
Expand Down

0 comments on commit b0e23b5

Please sign in to comment.