scrollToMessage method
void
scrollToMessage(})
Scroll to the message with the specified id
.
Implementation
void scrollToMessage(
String id, {
Duration? scrollDuration,
bool withHighlight = false,
Duration? highlightDuration,
AutoScrollPosition? preferPosition,
}) async {
await _scrollController.scrollToIndex(
chatMessageAutoScrollIndexById[id]!,
duration: scrollDuration ?? scrollAnimationDuration,
preferPosition: preferPosition ?? AutoScrollPosition.middle,
);
if (withHighlight) {
await _scrollController.highlight(
chatMessageAutoScrollIndexById[id]!,
highlightDuration: highlightDuration ?? const Duration(seconds: 3),
);
}
}