replaced scrollToEventId with current version from fluffychat

pull/1384/head
ggurdin 1 year ago
parent b021a2214c
commit e238068538
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -1108,14 +1108,14 @@ class ChatController extends State<ChatPageWithRoom>
inputFocus.requestFocus();
}
void scrollToEventId(String eventId) async {
// #Pangea
// final eventIndex = timeline!.events.indexWhere((e) => e.eventId == eventId);
void scrollToEventId(
String eventId, {
bool highlightEvent = true,
}) async {
final eventIndex = timeline!.events
.where((event) => event.isVisibleInGui)
.toList()
.indexWhere((e) => e.eventId == eventId);
// Pangea#
if (eventIndex == -1) {
setState(() {
timeline = null;
@ -1131,11 +1131,14 @@ class ChatController extends State<ChatPageWithRoom>
});
return;
}
setState(() {
scrollToEventIdMarker = eventId;
});
if (highlightEvent) {
setState(() {
scrollToEventIdMarker = eventId;
});
}
await scrollController.scrollToIndex(
eventIndex,
eventIndex + 1,
duration: FluffyThemes.animationDuration,
preferPosition: AutoScrollPosition.middle,
);
_updateScrollController();

Loading…
Cancel
Save