-
Notifications
You must be signed in to change notification settings - Fork 825
various improvements #864
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
base: main
Are you sure you want to change the base?
various improvements #864
Conversation
| final Widget? topWidget; | ||
|
|
||
| /// Widget to display as text, overriding message text. | ||
| final Widget? customWidget; |
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.
please remove this - if you don't want markdown you just don't use this lib - default is SimpleTextMessage that does not use markdown. If you need a 3rd party lib - you should just copy the code and change it, and provide your class to the textMessageBuilder - this is a correct way to fully override.
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 thing is, I want all the features of the FlyerChatTextMessage, and the nice UI, but I need to be able to render HTML.
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.
yep, just copy the code and use HTML :) I specifically created the builders pattern to avoid all the "customXXX" stuff that was everywhere in v1 - people would throw all sorts of things in there and then complain the package didn't work. Now, when someone needs something super custom, I prefer to give them full control and responsibility.
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.
Hmm, but thats a lot of code I need to copy, when I only want to change the display of one widget...
I guess I can just maintain a fork of this for my purposes.
| /// If `true`, typing enter will send the message, and typing shift+enter | ||
| /// will type enter. If `false`, typing shift+enter will send the message. | ||
| /// Defaults to `false`. | ||
| final bool sendOnEnter; |
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.
this feels incomplete. right now shift+enter will also send a message and enter will make a new line. if you want to send on enter - how user makes a new line?
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.
This variable makes it so that the message sends on enter, and shift+enter only adds a new line.
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.
I saw the change to send on enter, but did not see the code for the new line itself - is it automatic?
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.
I used an XOR operator for it on line 222 of composer.dart, inside your existing logic for this.
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.
It definitely works, I'm using it in my app right now.
Adds some various improvements and customization options