颤振|将 expandCenterPage 设置为 true 时出现 Carousel Slider 错误,

时间:2020-12-29 23:48:59

标签: flutter dart flutter-layout

我使用 carousel_slider: ^2.3.1 包实现了一个图像滑块。一切正常。但是,当我将 Options 上的 enlargeCenterProperty 设置为 true 时,调试器会捕获此错误。

enter image description here

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),
                            )

0 个答案:

没有答案