Skip to content

[How to use] 如何实现流式内容输出到气泡顶部和导航栏对齐时,就停留在那个位置不再往下滚动 #121

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

Closed
urrrich opened this issue Mar 12, 2025 · 3 comments
Assignees

Comments

@urrrich
Copy link

urrrich commented Mar 12, 2025

Platforms

dart

Description

如何实现流式内容输出到气泡顶部和导航栏对齐时,就停留在那个位置不再往下滚动

My code

No response

Try do it

No response

@LinXunFeng
Copy link
Member

可以通过观察结果里的 leadingMarginToViewporttrailingMarginToViewport,判断 item 与视口的顶部、底部的距离,来决定是否根据下一条来保持消息位置。

@urrrich
Copy link
Author

urrrich commented Mar 13, 2025

请教下在onObserve中如何控制保持消息位置

@LinXunFeng
Copy link
Member

onObserve 只是观察结果回调,保持消息位置是靠 standby 方法。

你可以在 onObserve 里记录观察结果,或者 dispatchOnceObserve(isForce: true, isDependObserveCallback: false) 去拿观察结果,在更新消息准备刷新之前根据观察结果来判断是否调用 standby

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