# MessageCollectionHandler with Provider

**URL:** <https://community.sendbird.com/t/messagecollectionhandler-with-provider/8821>\
**Category:** Flutter\
**Tags:** group-channel\
**Created:** [December 30, 2023, 5:00pm UTC](https://community.sendbird.com/t/messagecollectionhandler-with-provider/8821 "2023-12-30T17:00:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Latham](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/nicholas_latham/32/369_2.png) [@Nicholas\_Latham](https://community.sendbird.com/u/Nicholas_Latham)\
**Post date:** [December 30, 2023, 5:00pm UTC](https://community.sendbird.com/t/messagecollectionhandler-with-provider/8821/1 "2023-12-30T17:00:58Z")

</div>

Hi, I have recently switched to using to using the MessageCollection and while I can get everything to work using the sample app as a guide, I find that setting state again when a message is received (as per the sample MyMessageCollectionHandler) to not be very performant. I am trying therefore to combine with using the provider package, but I am struggling with how to integrate MyMessageCollectionHandler into it so that the collection updates when a new message is received.

Any advice?

---

<div class="post-metadata">

**Author:** ![Nicholas\_Latham](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/nicholas_latham/32/369_2.png) [@Nicholas\_Latham](https://community.sendbird.com/u/Nicholas_Latham)\
**Post date:** [January 21, 2024, 9:45am UTC](https://community.sendbird.com/t/messagecollectionhandler-with-provider/8821/2 "2024-01-21T09:45:28Z")

</div>

I resolved this issue 😃
