We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.25.1
dart
iPhone 12(iOS 18)
flutter 3.27.4
消息内部有折叠、展开,且滚动位置位于底部(position.pixels==0)的时候,点击展开会向上伸展
onExpand: (visible) { // 不在底部的时候不会有问题 if (_scrollController.position.pixels == 0) { _scrollController.jumpTo(6); } final isLastItem = index == _messages.length - 1; final refItemIndex = isLastItem ? index : index + 1; chatObserver.standby( mode: ChatScrollObserverHandleMode.specified, refIndexType: ChatScrollObserverRefIndexType.itemIndex, refItemIndex: refItemIndex, refItemIndexAfterUpdate: refItemIndex, customAdjustPosition: (model) { // 仅处理最后一个 item 的情况 if (!isLastItem) return null; // 使用 变化前后的底部间距差 来保持位置 final delta = model.newPosition.extentAfter - model.oldPosition.extentAfter; // debugPrint(model.adjustPosition + delta); return model.adjustPosition + delta; }, customAdjustPositionDelta: (model) { // 仅处理不是最后一个 item 的情况 if (isLastItem) return null; // 以 变化前后的 item 偏移差 来保持位置 final adjustPosition = model.adjustPosition; final delta = model.currentItemModel.layoutOffset - model.observer.refItemLayoutOffset; if (delta < 0) { // 收起 // 因消息的高度太大,在收起时,Flutter 内部对列表的偏移计算有问题 // 所以这里调整计算方式,改为:视口的当前偏移量 - 内容变化量 // 注:减去 adjustPosition,是因为保持位置功能的内部会加上 adjustPosition return model.currentItemModel.viewportPixels + delta - adjustPosition; } // 展开 return delta; }, ); },
No response
The text was updated successfully, but these errors were encountered:
了解一下 fixedPositionOffset 的作用 3.1、基本使用
fixedPositionOffset
fixedPositionOffset = -1
Sorry, something went wrong.
LinXunFeng
No branches or pull requests
Version
1.25.1
Platforms
dart
Device Model
iPhone 12(iOS 18)
flutter info
How to reproduce?
消息内部有折叠、展开,且滚动位置位于底部(position.pixels==0)的时候,点击展开会向上伸展
Logs
Example code (optional)
Contact
No response
The text was updated successfully, but these errors were encountered: