Skip to content
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

demo里关于聊天演示,在第一次加载数据超过一屏的时候,下拉的时候isShrinkWrap是true,导致只能显示一部分数据 #47

Closed
atiman opened this issue Sep 13, 2023 · 3 comments

Comments

@atiman
Copy link

atiman commented Sep 13, 2023

如果我增加一条数据,是调用了chatObserver.standby(changeCount: count),然后scrollView_observer就把isShrinkWrap修改为了false,有什么办法在我第一次进入聊天,根据当前数据多少,来修改isShrinkWrap的值,现在貌似第一次进入聊天,isShrinkWrap都是true

@LinXunFeng
Copy link
Member

可以在加载完数据并完成布局后手动触发一次观察,来校正 isShrinkWrap

WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
  chatObserver.observeSwitchShrinkWrap();
});

@atiman
Copy link
Author

atiman commented Sep 13, 2023

好的,解决了,谢谢

@LinXunFeng
Copy link
Member

1.16.5 版本中,初始化时做了一次校正,不用再自己手动触发,请升级试试看吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants