Skip to content

Commit

Permalink
Added optional scroll preferPosition to scrollController.scrollToIndex (
Browse files Browse the repository at this point in the history
  • Loading branch information
chdo002 authored May 30, 2024
1 parent 1053764 commit 1f9d6ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/widgets/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,12 @@ class ChatState extends State<Chat> {
Duration? scrollDuration,
bool withHighlight = false,
Duration? highlightDuration,
AutoScrollPosition? preferPosition
}) async {
await _scrollController.scrollToIndex(
chatMessageAutoScrollIndexById[id]!,
duration: scrollDuration ?? scrollAnimationDuration,
preferPosition: AutoScrollPosition.middle,
preferPosition: preferPosition ?? AutoScrollPosition.middle,
);
if (withHighlight) {
await _scrollController.highlight(
Expand Down

0 comments on commit 1f9d6ed

Please sign in to comment.