refactor: More stable scroll to event
This commit is contained in:
parent
038cd9cb73
commit
7d112b1e18
3 changed files with 21 additions and 4 deletions
|
|
@ -367,6 +367,8 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
return;
|
||||
}
|
||||
|
||||
String? scrollToEventIdMarker;
|
||||
|
||||
Future<void>? _setReadMarkerFuture;
|
||||
|
||||
void setReadMarker({String? eventId}) {
|
||||
|
|
@ -912,6 +914,9 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
});
|
||||
return;
|
||||
}
|
||||
setState(() {
|
||||
scrollToEventIdMarker = eventId;
|
||||
});
|
||||
await scrollController.scrollToIndex(
|
||||
eventIndex,
|
||||
preferPosition: AutoScrollPosition.middle,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue