Skip to content
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

Overflow exception #60

Closed
jaumard opened this issue Apr 21, 2020 · 7 comments · Fixed by #59
Closed

Overflow exception #60

jaumard opened this issue Apr 21, 2020 · 7 comments · Fixed by #59

Comments

@jaumard
Copy link
Contributor

jaumard commented Apr 21, 2020

Describe the bug
There is an overflow exception when the chat doesn't take the full width of the screen

To Reproduce
Use chat dash in master detail view and send a very long message

Expected behavior
Not having overflow

Screenshots
Capture d’écran 2020-04-21 à 10 43 07

@fayeed
Copy link
Owner

fayeed commented Apr 21, 2020

I think this is because of this:

maxWidth: MediaQuery.of(context).size.width * 0.8,

This could easily be resolved by using LaoutBuilder in messageContainer.

@jaumard
Copy link
Contributor Author

jaumard commented Apr 21, 2020

Yes that's why, I'm fixing it right now to remove all MediaQuery usage to use layoutBuilder

@jaumard
Copy link
Contributor Author

jaumard commented Apr 21, 2020

I've made the modifications to use layoutBuilder, but it doesn't work as in some case constraints return infinity as height and width. Instead I think we should use FractionallySizedBox to avoir doing the calculation ourselves

@fayeed
Copy link
Owner

fayeed commented Apr 21, 2020

I think this might be an issue with wrapping the root widget DashChat with LayoutBuilder it would be better to wrap MessageListView

@fayeed
Copy link
Owner

fayeed commented Apr 21, 2020

or maybe try the solution you mentioned.

@jaumard
Copy link
Contributor Author

jaumard commented Apr 21, 2020

I have started like this but problem is that other Widget need the constraint (QuickReply, ContainerAvatar...) and I didn't want to wrap all of them with a layoutBuilder to gain in performance as only one is needed. I'll make some try some things....

@jaumard
Copy link
Contributor Author

jaumard commented Apr 21, 2020

Ok look like it works with layoutBuilders you can check the PR #59 here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants