PageView在更改的页面抖动中进行更改

时间:2020-06-20 06:17:05

标签: flutter pageviews

我有一个PageView.builder,想在向左或向右滑动时重建页面。我该怎么做?

PageView.builder(
            controller: _controller,
            itemCount: items.length,
            allowImplicitScrolling: true,
            reverse: false,
            onPageChanged: _onPageChanged,
            itemBuilder: (context, position) => MyCustomPage(
                  item: _item,
                  onUpdate: ( controller) =>
                      _onUpdate(controller),
                )),
void _onPageChanged(int position) {
    _item = _items[position];
    _style = ItemStyle.none;
    _callSetStateIfNeeded();
  }

0 个答案:

没有答案