fluttercandies / flutter_scrollview_observer

A widget for observing data related to the child widgets being displayed in a ScrollView. Maintainer: @LinXunFeng
https://pub.dev/packages/scrollview_observer
MIT License
451 stars 46 forks source link

[Bug report] 无法滚动到指定下标位置 #74

Closed feimenggo closed 8 months ago

feimenggo commented 8 months ago

Version

1.19.0

Platforms

macOS

Device Model

MacBook Pro M1

flutter info

 Flutter (Channel stable, 3.19.3, on macOS 14.2.1 23C71 darwin-arm64, locale zh-Hans-CN)

How to reproduce?

当使用ListView的itemExtentBuilder时,无法滚动到指定下标位置。 而不使用itemExtentBuilder时,可以正常滚动到指定下标位置。

Logs

No response

Example code (optional)

No response

Contact

No response

LinXunFeng commented 8 months ago

周末我再发个版本解决,如果着急可以先按如下处理

ListViewObserver(
  child: _buildListView(),
  ...
+  customTargetRenderSliverType: (renderObj) {
+    return renderObj is RenderSliverVariedExtentList;
+  },
  ...
);
feimenggo commented 8 months ago

好的

LinXunFeng commented 8 months ago

请升级使用 1.19.1 版本