我使用 carousel_slider: ^2.3.1 包实现了一个图像滑块。一切正常。但是,当我将 Options 上的 enlargeCenterProperty 设置为 true 时,调试器会捕获此错误。
CarouselSlider(
carouselController: CarouselController(),
items: <Widget>[
Container(height:100),
Container(height:100),
Container(height:100),
],
options: CarouselOptions(
//when this line is commented the error vanishes
enlargeCenterPage: true,
height: 180.0,
enlargeStrategy: CenterPageEnlargeStrategy.scale,
aspectRatio: 16 / 9,
autoPlayCurve: Curves.fastOutSlowIn,
enableInfiniteScroll: true,
autoPlayAnimationDuration:
Duration(milliseconds: 800),
viewportFraction: 0.8,
initialPage: 0,
autoPlay: true),
)