[플러터] CarouselSlider 매개 변수 'onPageChanged'가 정의되지 않아 에러가 날때..


CarouselSlider(
items: images,
onPageChanged: (index,reason) {
setState(() {
_currentPage = index;
_currentKeyword = keywords[_currentPage];
});
},
),


내부에 코드를 추가합니다 CarouselOptions을 추가한다.

CarouselSlider(
items: images,
options: CarouselOptions(
onPageChanged: (index, reason) {
setState(() {
_currentPage = index;
_currentKeyword = keywords[_currentPage];
});
}
),
),

댓글

이 블로그의 인기 게시물

유니티 오브젝트 서서히 사라지게

WebView에서 YOUTUBE 동영상 플레이 방법