Feat/link preview package#790
Conversation
|
PS : maybe we can could expose the message backGroundColor and/or the isSentbyMe in the builder to adapt colors to the chatMessage. I did not want to make this package use |
This was done to allow the time and status indicators to stay aligned at the end, without forcing the message bubble to grow to full width. I literally tried everything, and the best suggestion I found was to use Eventually, I came across this small article that saved me - it explains the issue really well: The same problem actually happens with link previews too. If you open the app on macOS, for example, the link previews are huge 😅 That’s why I added constraints - people will likely want to set them if they’re targeting desktop (or even web, if they serve previews from their own backend). Unless… maybe we introduce a
Yes, I was thinking about exposing As for background color - I’m not so sure. I’d prefer not to expose UI-specific details in the builders. |
Ok it was to constrain the I think I actually have same problem for reactions. If message is short with many reactions. Will have to test. LinkPreview
For the color I dont have any better idea. You are correct someone overriding chatBubble will likely have his own helper methods to calculate both color (since Maybe we can add getters on ChatTheme to retrieve From my perspective If I set up a custom ChatTheme and use flyerchat's widgets I'd expect everything to work out of the box (I I do not override colors in the Message's builders) but there is no perfect solution
|
ce0f8e7 to
c4f9239
Compare
|
Fixes + rebase |
52e98ca to
afe64c8
Compare
|
About 0aba7f1
See headers and then last line here Regarding 33e583f
Finally and has a side note, i'm not sure if we should return the redirected (and proxied) redirectUrl has the |
9d47d14 to
0364318
Compare
0364318 to
f2eda49
Compare
|
had to re-write the widget from scratch as I didn't like that it was stretching for the whole width, so I added support of min and max width of the preview itself, using calculation of the parent text. From my testing everything is working nicely! I also changed package name to the original one to keep the same project on pub.dev |

As discused in the former link_preview repo flyerhq/flutter_link_previewer#63 this PR aims at
flutter_chat_typesSidenote
@demchenkoalex
I had to rewrite the
SimpleTextMessageandFlyerTextMessageto account for both the timeAndStatus and the previex position.Also i noticed in your Stack you had an hidden timeAndStatus
flutter_chat_ui/packages/flutter_chat_ui/lib/src/simple_text_message.dart
Line 190 in a0c5eca
I suspect it was to make the bubble big enough for the time but this has no effect if not put inside a column (it stacks on the textContent).
I think it actually worked because of this line
flutter_chat_ui/packages/flutter_chat_ui/lib/src/simple_text_message.dart
Line 187 in a0c5eca
I used the same trick
but if you prefer we can add a hidden
timeAndStatusso we are sure it's the proper sizeScreens