-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for overriding bubbleMargin using ChatTheme #585
Conversation
very similar to what i did. Sorry i did not see your work, because it does not mention the corresponding task #496 |
My bad, I should've mentioned the open issue in my PR to avoid duplicated work. I think, though, the ability to completely override the entire margin offers higher flexibility and could be a better approach. What do you think @qeepcologne? |
I think you have no access to bubbleRtlAlignment in ChatTheme. If you want the same behaviour just with less padding how to do that? |
Since flutter_chat_ui/lib/src/widgets/chat.dart Line 43 in d559096
I think the user can simply access the value that they are passing to Chat . If a user is overriding the base functionality, I think it is reasonable to ask the user to completely handle that themselves. Alternatively, to achieve what I think you are trying for (to only modify the left padding), bubbleMargin could be modified to rather be EdgeInsets Function({required EdgeInsets defaultBubbleMargin}) or the package can simply expose getDefaultBubbleMargin as a util function. I prefer the latter as that still keeps the functionality as simple as possible.
|
EdgeInsets is well known, clear and flexible. But if you want to use the full width you have to do some caculations: |
Yep, for now, I think the current implementation should be sufficient. Let me know if you want me to update this PR to also export a |
Sorry for the late reply, i tried to switch to your branch today:
|
Great catch. Updated to use |
@demchenkoalex Could you please review this pull request? Are there any additional changes required before it can be merged? |
thanks for the PR :) |
Hi @demchenkoalex, Sorry for the ping. When can we get this released? Our app is needing this exact feature |
@theprojectfactory In the mean time until there is a new release, you can also directly target the exact code you want using
|
just came back from PTO, will release this week |
What does it do?
This change adds support for overriding the bubbleMargin property using ChatTheme.
Why is it needed?
This allows users of the package to customize the margin of the chat bubbles, enabling scenarios where the user wants the message to take the entire width of the screen.