-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug report] 一個頁面有多個LoadingMoreSliverList, 第一個list的indicatorBuilder不會觸發IndicatorStatus.noMoreLoad #58
Comments
有个参数,默认是 中间的都不显示,你可以自己改下 |
hi, 你是說 |
因为第2个不适合全屏幕的loading呢。。直接用的小loading |
是的,但我測試滑到第二個list時,第二個list的indicatorBuilder沒有觸發(沒有小loading),過一下子data會直接出現,繼續往下滑時load more時才有 |
没有重现。你直接说需求。或者自己debug 下过程。
|
我的需求是:當滑到第二個list時,最一開始載入list2也能顯示小loading(IndicatorStatus.loadingMoreBusying的loading),讓滑動的感覺有接續第一個list的效果,我剛剛有看了下程式碼, 跟你確認下: loading_more_list/lib/src/loading_more_sliver_list.dart Lines 319 to 334 in 9afe699
這邊應該是第二個sliver及之後,呼叫 refresh() 時,notifyStateChanged預設是false(要為true才會有loading狀態及效果),但由於非第一個sliver,不適合全螢幕的loading,所以https://github.com/fluttercandies/loading_more_list_library/blob/6fd12633097953544732f46cff94f6b10bf4e3b2/lib/src/loading_more_list_library.dart#L72-L81 這邊要多判斷一個參數來決定 indicatorStatus 要為IndicatorStatus.fullScreenBusying 還是 IndicatorStatus.loadingMoreBusying
可以由:
這邊的index來知道是否非第一個sliver,我這樣理解對嗎~? |
你第2个列表全屏幕loading 用 loading more 多ui 就好了 |
什麼意思~? |
fullScreenBusying 换成 loadingMoreBusying 的ui |
好的 我試下 感謝 |
我再請問下~ Screen_Recording_20240620_121256_1.mp4請問refresh list1時,該怎麼將list2 reset~? |
下啦刷新。重新new configs。 除了clear 你还需要通知ui 更新。你可以看看代码 onstatechanged |
觸發onstatechanged的是setState方法對嗎:
但我剛剛實測我自己在繼承於LoadingMoreBase的controller中宣告的reset()方法
這樣子看起來是可以(不用呼叫setState()也可以), 2024-06-20.2.54.09.mp4但你有註解:
|
可以就行。影响不大,只是不希望外部随意就改变。你知道流程就无所谓 |
Version
6.0.0
Platforms
dart
Device Model
iPhone 15 Pro
flutter info
How to reproduce?
一個頁面有多個LoadingMoreSliverList的話,第一個list的indicatorBuilder不會觸發
IndicatorStatus.noMoreLoad
。兩個list應該要有各自獨立的行為對嗎? 還是該如何正確的使用~?
Logs
No response
Example code (optional)
Contact
No response
The text was updated successfully, but these errors were encountered: