chore: ScrollToEventId duration for jump in timeline
This commit is contained in:
parent
9af92267ed
commit
e7b0f02d2d
2 changed files with 6 additions and 3 deletions
|
|
@ -783,7 +783,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
inputFocus.requestFocus();
|
||||
}
|
||||
|
||||
void scrollToEventId(String eventId) async {
|
||||
void scrollToEventId(String eventId, {Duration? duration}) async {
|
||||
var eventIndex = timeline!.events.indexWhere((e) => e.eventId == eventId);
|
||||
if (eventIndex == -1) {
|
||||
setState(() {
|
||||
|
|
@ -799,6 +799,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
await scrollController.scrollToIndex(
|
||||
eventIndex,
|
||||
preferPosition: AutoScrollPosition.middle,
|
||||
duration: duration ?? scrollAnimationDuration,
|
||||
);
|
||||
_updateScrollController();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue