replaced scrollToEventId with current version from fluffychat
This commit is contained in:
parent
b021a2214c
commit
e238068538
1 changed files with 11 additions and 8 deletions
|
|
@ -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…
Add table
Reference in a new issue