简体   繁体   中英

Carousel Slider in Flutter

I have carousal slider but when i slide the image it takes me to the next page instead of next image in slider. What can i do to fix the problem.

CarouselSlider(
                                  items: widget.catData["tradeWithPictures"]
                                      .map<Widget>((e) {
                                    return Container(
                                      width: Get.width,
                                      child: CachedNetworkImage(
                                        fit: BoxFit.cover,
                                        imageUrl: e['url'],
                                        placeholder: (context, url) => Center(
                                            child: CircularProgressIndicator()),
                                        errorWidget: (context, url, error) =>
                                            Icon(Icons.error),
                                      ),
                                    );
                                  }).toList(),
                                  carouselController:
                                      postController.carouselController,
                                  options: CarouselOptions(

                                    autoPlay: true,
                                    enableInfiniteScroll: true,



                                    height: Get.height * .7,
                                    viewportFraction: 1.0,
                                    enlargeCenterPage: false,
                                    aspectRatio: 1 / 1.3,
                                    onPageChanged: (index, reason) {
                                     // postController.tradeImagesIndex(index);
                                     // postController.carouselController.nextPage();
                                    },
                                  ),
                                ),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM