chore: Follow up scroll down in fragmented timeline
This commit is contained in:
parent
fc052c84ac
commit
e80e3273ea
1 changed files with 12 additions and 1 deletions
|
|
@ -231,6 +231,17 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
|
|
||||||
if (mostRecentEvent != null) {
|
if (mostRecentEvent != null) {
|
||||||
setReadMarker(eventId: mostRecentEvent.eventId);
|
setReadMarker(eventId: mostRecentEvent.eventId);
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
final index = timeline.events.filterByVisibleInGui().indexOf(
|
||||||
|
mostRecentEvent,
|
||||||
|
);
|
||||||
|
if (index >= 0) {
|
||||||
|
scrollController.scrollToIndex(
|
||||||
|
index,
|
||||||
|
preferPosition: AutoScrollPosition.begin,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -458,7 +469,7 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
|
|
||||||
void onInsert(int i) {
|
void onInsert(int i) {
|
||||||
// setState will be called by updateView() anyway
|
// setState will be called by updateView() anyway
|
||||||
if (i <= 5) animateInEventIndex = i;
|
if (timeline?.allowNewEvent == true) animateInEventIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _getTimeline({String? eventContextId}) async {
|
Future<void> _getTimeline({String? eventContextId}) async {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue