flutter_chat_ui icon indicating copy to clipboard operation
flutter_chat_ui copied to clipboard

How to add a widget at the top that scrolls with messages?

Open kornha opened this issue 2 years ago • 12 comments

Hello 👋

My use case: I want the Chat() widget to appropriately scroll with another widget on the screen. Eg., I am adding a widget to the top of all the chat messages, and I want to scroll past it like another message! I suspect this not current possible but I would love some guidance.

I think it is not possible because Chat() is not using the parent's scrollController correctly, even when this is passed it. Chat(...) always scrolls independently of the outer scaffold. Is this a known issue? Any thoughts how to address or accomplish my use case?

kornha avatar Oct 14 '23 09:10 kornha

Okay, I found a nice solution. I am adding locally a "pinned Widget" that will render a widget at the very top of the messages. Happy to create a PR for this if it will be helpful

kornha avatar Oct 14 '23 10:10 kornha

hey @kornha currently working on a v2 re-design of the package and I will make sure to include options to have widgets scrollable with messages on both top and bottom of the list. Thanks!

demchenkoalex avatar Oct 23 '23 07:10 demchenkoalex

This is a use case I'm also concerned with. Do we have any solution for it?

prachishukla007 avatar Nov 30 '23 12:11 prachishukla007

figuring out last bits of architecture for v2, still in progress. I don't think there is a solution in v1 :/

demchenkoalex avatar Nov 30 '23 22:11 demchenkoalex

确定 v2 架构的最后部分,仍在进行中。我认为 v1 中没有解决方案:/

When will v2 be released?

988494 avatar Dec 06 '23 06:12 988494

No timelines, I was going pretty fast with it for the last month or so, but now my parents came from my occupied home town after 5 years and I am helping them to build a new life in a new country, so had no chance to work on v2 recently. I am planning to do most of the work at the end of December and see how things will look for January 2024.

demchenkoalex avatar Dec 06 '23 16:12 demchenkoalex

I am planning to do most of the work at the end of December and see how things will look for January 2024.

Looking forward to the v2, @demchenkoalex !

tincleo avatar Dec 22 '23 07:12 tincleo

Yeah me as well :) continuing work now

demchenkoalex avatar Dec 25 '23 15:12 demchenkoalex

Kindly inform once Version 2 is finalized so that I can address this issue accordingly. Thanks.

prachishukla007 avatar Jan 12 '24 08:01 prachishukla007

@prachishukla007 no update unfortunately, lots of work at the beginning of the year at my company. If your business depends on this issue, I would fork or look for alternatives as of right now. Will update as soon as there is progress (still 1 major architecture issue, then beta, then release)

demchenkoalex avatar Jan 15 '24 03:01 demchenkoalex

I tried to find any alternative of it but it doesn't seem like there is any solution of it right now. Yes, please update as soon as possible.

prachishukla007 avatar Jan 29 '24 10:01 prachishukla007

If the new version isn't coming any time soon. I can fork this version and make a modification of this version. I think in textMessageBuilder() in message.dart. I can just create the textmessage like normal and then pass it to the builder. The builder can then decide to display the default text message with new widgets. Or make a whole new one.

What do you think?

Edit: Or I can add it to where the bubble is created. So include the default bubble potentially with whatever extra stuff is wanted.

asoap avatar Jan 29 '24 22:01 asoap