
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
4주차 강의자료
-> 5) Google Book API 호출하기 항목에
-> 7. "86번째 줄 onSubmitted 의 중괄호 사이에 아래 코드스니펫을 붙여넣습니다."
에서 제공된 코드스니펫은 아래와 같습니다.
bookService.search(value);
하지만 전체 코드에는
bookService.search(value); 복사한 소문자 b는 상단의 BookService를 받지 못하기에 대문자로 작성되어야 하는게 아닐까요?
@override //77번째 줄
Widget build(BuildContext context) {
return Consumer<BookService>(
builder: (context, BookService, child) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
toolbarHeight: 80,
title: TextField(
onSubmitted: (value) { //86번째 줄
BookService.search(value); //bookService.search(value); 복사한 소문자 b는 상단의 BookService를 받지 못하기에 대문자로 작성되어야 하는게 아닐까요?
},
cursorColor: Colors.grey,
decoration: InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.grey),
hintText: "작품, 감독, 배우, 컬렉션, 유저 등",
border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
borderRadius: BorderRadius.all(Radius.circular(10)),
),
),
),
),
body: Center(
child: Text("검색"),
),
);
},
);
}
}

