Skip to content

I don't understand how to call scrollToMessage or scrollToIndex #835

Answered by demchenkoalex
devberkay asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry missed this post. There is ScrollToMessageMixin exported from flutter_chat_core. The way you use it - if you have a custom chat controller (implements ChatController), you can also add with ScrollToMessageMixin there, and call disposeScrollMethods in your controller's dispose method. You can find it in the example here as well.

If you use provided InMemoryChatController it's already included.

Now if you use that controller of yours with your Chat widget chatController: _chatController,, you can call scrollToMessage or scrollToIndex on it.

If you use chatAnimatedListBuilder, you need to use ChatAnimatedList or ChatAnimatedListReversed since they implement that logic, if you build you…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@demchenkoalex
Comment options

Answer selected by demchenkoalex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants