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 7a7bff6 commit 6c212f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/flutter_http_example/lib/book.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Book {
static List<Book> listFromJson(Map<dynamic, dynamic> json) {
final books = <Book>[];

if (json['items'] is List<dynamic>) {
final items = (json['items'] as List).cast<Map<String, Object?>>();
if (json['items'] case final List jsonItems) {
final items = jsonItems.cast<Map<String, Object?>>();

for (final item in items) {
if (item.containsKey('volumeInfo')) {
Expand Down

0 comments on commit 6c212f9

Please sign in to comment.