PageView
PageView copied to clipboard
Not support dynamic list data
It works perfectly if we have a fixed length of data. Unfortunately, it does not support dynamic data. Here is a demo
// viewModel.state.list is fetched after fetchNextPageIfPossible
VPageView(selectedPage: $pageIndex) {
ForEach(viewModel.state.list, id: \.self) { _ in
ImageCell(urlStr: Image.fullScreenDemo)
}
}
.onAppear {
viewModel.reset()
viewModel.fetchNextPageIfPossible()
}
.background(Color(hex: "2A3A3F"))