-
Notifications
You must be signed in to change notification settings - Fork 38
feat(neon_talk): Implement rich objects rendering #1910
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
Conversation
939f30f to
68812be
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1910 +/- ##
==========================================
+ Coverage 28.75% 28.82% +0.07%
==========================================
Files 198 203 +5
Lines 67697 68243 +546
==========================================
+ Hits 19466 19674 +208
- Misses 48231 48569 +338
*This pull request uses carry forward flags. Click here to find out more.
|
Leptopoda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The algorithm for splitting the message and replacing the rich objects might not be the best one, but I found this to be relatively simple and I couldn't think of a much better solution.
I didn't try to 100% understand the algorithm but if it does the job let's go with it.
I think that the TalkRichObjectMention has to respect the text scale. Optimally the entire chip should not be larger than the surrounding text. Now the text in the chip is already larger.
packages/neon/neon_talk/lib/src/widgets/rich_object/fallback.dart
Outdated
Show resolved
Hide resolved
68812be to
fa0b80f
Compare
Leptopoda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to propagate the textstyle through the BuildContext? That should allow future mistakes.
I suggest to wrap the entire systemMessage in a DefaultTextStyle widget and let the children build according to the current default style.
This doesn't work for the Chips because they rely on the ChipThemeData and do not consider the DefaultTextStyle. I think we will just have to live with it, even though I like your idea. |
fa0b80f to
b2a6519
Compare
Signed-off-by: provokateurin <[email protected]>
Signed-off-by: provokateurin <[email protected]>
b2a6519 to
3184e37
Compare

The algorithm for splitting the message and replacing the rich objects might not be the best one, but I found this to be relatively simple and I couldn't think of a much better solution.
The first commit basically backports a change that will also come with #1894, so we might just want to wait for 29 to land before merging this.
Not all parameter types are supported yet, because i wasn't able to test the maps integration for geo-location (I think it is broken) and displaying vcards can be done later as it is not that important imo. Polls are also not implemented, but that's because they are a whole different thing we need to support and it would bloat this PR which just gets the basics into place.