Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 我的名单赢了';t在它之后更新事件';s指数_Flutter_Dart - Fatal编程技术网

Flutter 我的名单赢了';t在它之后更新事件';s指数

Flutter 我的名单赢了';t在它之后更新事件';s指数,flutter,dart,Flutter,Dart,好吧,我对颤振还很陌生,我为此做了很多尝试,但我认为我没有用正确的想法解决这个问题。 所以我在这里问,当我在旋转木马中更改页面时,如何更改列表中的索引。 我切换到StatefulWidget只是为了使用setState(),但它没有改变任何东西,我想我可能需要使用某种通知程序,但我几乎从未使用过它们,所以我不知道如何在这里实现它们 Column ( children: [ CarouselSlider( items: myBoards, option

好吧,我对颤振还很陌生,我为此做了很多尝试,但我认为我没有用正确的想法解决这个问题。 所以我在这里问,当我在旋转木马中更改页面时,如何更改列表中的索引。 我切换到StatefulWidget只是为了使用setState(),但它没有改变任何东西,我想我可能需要使用某种通知程序,但我几乎从未使用过它们,所以我不知道如何在这里实现它们

Column (
  children: [
     CarouselSlider(
        items: myBoards,
        options: CarouselOptions(
           enableInfiniteScroll: false,
           height: 80,
           viewportFraction: 0.8,
           initialPage: 0,
           reverse: false,
           enlargeCenterPage: true,
           onPageChanged: (index, reason) {
              setState(() {
                 _currentIndex = index;
              });
           },
           scrollDirection: Axis.horizontal,
        )
     ),
     Container(
        width: MediaQuery.of(context).size.width * 0.90,
        child: CropListView(Controller: Controller,documents: documents, index: _currentIndex),
     ),
  ],
);

您是否验证了onPageChanged正在被调用,并且索引与以前的值不同?是的,我验证了,一切正常只是listView没有更新