小编Zor*_*shi的帖子

如何在不使用构建器的情况下自动滚动带有一些延迟的 PageView?

我制作了一个用作图像轮播的 PageView。在 Flutter 延迟一段时间后,如何让它在页面之间自动滚动?

                new PageView(
                    children: List<Widget> {
                        new Container(
                            decoration: BoxDecoration(
                                image: DecorationImage(image: new AssetImage(images[0]), 
                                fit: BoxFit.cover
                                )
                            )
                        ),
                        new Container(
                            decoration: BoxDecoration(
                                image: DecorationImage(image: new AssetImage(images[1]), 
                                fit: BoxFit.cover
                                )
                            )
                        ),
                        new Container(
                            decoration: BoxDecoration(
                                image: DecorationImage(image: new AssetImage(images[2]), 
                                fit: BoxFit.cover
                                )
                            )
                        )
                    }
                )
Run Code Online (Sandbox Code Playgroud)

dart flutter

9
推荐指数
1
解决办法
6533
查看次数

标签 统计

dart ×1

flutter ×1