Is it possible to have a custom attribute and styling for a given set of text? #564
Replies: 2 comments
-
@mark8044 did you ever implement something like this? I am also looking at this atm and in the web I would use https://github.com/quill-mention/quill-mention, but it appears this is not possible with flutter-quill currently? |
Beta Was this translation helpful? Give feedback.
-
You don't need custom attributes for things like mentions, because you can define your own embed, in your case just define MentionAtUserEmbed and returns widget which is essentially just plain old Container and Text with your desired padding, backgroundColor, borderRadius, padding, textStyle etc. Your custom embed type can be a simple string, something like 'refDocument', 'atUser', 'refBook', |
Beta Was this translation helpful? Give feedback.
-
What I'm trying to build in is a system where username mentions are highlighted in the quill editor, which would look like
@someuser
Notice how
@someuser
has its own highlight separate from the rest of the text.In my mind, this would require a new attribute, lets call it mention with a value of userid for the backend to understand who it is. We would also need to then style the text to give it a grey background and say a text color change.
Is something like this possible with the package as it stands? If so where would I begin?
Beta Was this translation helpful? Give feedback.
All reactions