
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
Exception has occurred.
_TypeError (type 'String' is not a subtype of type 'List<dynamic>')
오류가 생깁니다.

작성한 코드 및 에러 메세지
오import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'book.dart';
class BookService extends ChangeNotifier {
List<Book> bookList = []; // 책 목록
List<Book> likedBookList = [];
void toggleLikeBook({required Book book}) {
String bookId = book.id;
if (likedBookList.map((book) => book.id).contains(bookId)) {
likedBookList.removeWhere((book) => book.id == bookId);
} else {
likedBookList.add(book);
}
notifyListeners();
}
void search(String q) async {
bookList.clear(); // 검색 버튼 누를때 이전 데이터들을 지워주기
if (q.isNotEmpty) {
Response res = await Dio().get(
"https://www.googleapis.com/books/v1/volumes?q=$q&startIndex=0&maxResults=40",
);
List items = res.data["items"];
for (Map<String, dynamic> item in items) {
Book book = Book(
id: item['id'],
title: item['volumeInfo']['title'] ?? "",
subtitle: item['volumeInfo']['subtitle'] ?? "",
authors: item['volumeInfo']['authors'] ?? "",
publishedDate: item['volumeInfo']['publishedDate'] ?? "",
thumbnail: item['volumeInfo']['imageLinks']?['thumbnail'] ??
previewLink: item['volumeInfo']['previewLink'] ?? "",
);
bookList.add(book);
}
}
notifyListeners();
}
}
