@@ -13,9 +13,7 @@ abstract class GoogleBooksAdapter {
1313 if (json['items' ] == null ) {
1414 return [];
1515 }
16- return (json['items' ] as List )
17- .map ((bookMap) => fromJson (bookMap))
18- .toList ();
16+ return (json['items' ] as List ).map ((bookMap) => fromJson (bookMap)).toList ();
1917 }
2018
2119 /// This method was extracted from the [BookModel] class in order to ensure that if one were to change the book API,
@@ -24,21 +22,21 @@ abstract class GoogleBooksAdapter {
2422 return BookModel (
2523 id: map['id' ],
2624 title: map['volumeInfo' ]['title' ],
27- authors:
28- List <String >.from (map['volumeInfo' ]['authors' ] ?? ['Unknown Author' ])
29- .map ((author) => AuthorModel (name: author))
30- .toList (),
25+ authors: List <String >.from (
26+ map['volumeInfo' ]['authors' ] ?? ['Unknown Author' ],
27+ ).map ((author) => AuthorModel (name: author)).toList (),
3128 publisher: map['volumeInfo' ]['publisher' ] ?? 'Unknown Publisher' ,
3229 description:
3330 map['volumeInfo' ]['description' ] ?? 'No description available' ,
3431 categories: List <String >.from (
35- map['volumeInfo' ]['categories' ] ?? ['Unknown category' ])
36- .map ((category) => CategoryModel (name: category))
37- .toList (),
32+ map['volumeInfo' ]['categories' ] ?? ['Unknown category' ],
33+ ).map ((category) => CategoryModel (name: category)).toList (),
3834 pageCount: map['volumeInfo' ]['pageCount' ] ?? 0 ,
39- imageUrl: (map['volumeInfo' ]['imageLinks' ]? ['thumbnail' ] ??
35+ imageUrl:
36+ (map['volumeInfo' ]['imageLinks' ]? ['thumbnail' ] ??
4037 'https://books.google.com.br/googlebooks/images/no_cover_thumb.gif' ),
41- buyLink: map['volumeInfo' ]['infoLink' ] ??
38+ buyLink:
39+ map['volumeInfo' ]['infoLink' ] ??
4240 'https://play.google.com/store/books?' ,
4341 averageRating: (map['volumeInfo' ]['averageRating' ] ?? 0.0 ).toDouble (),
4442 ratingsCount: map['volumeInfo' ]['ratingsCount' ] ?? 0 ,
0 commit comments