Open geweald opened 1 month ago
Hi @geweald
We are using flutter_markdown 0.6.17+1, in this version's documentation there is no Selection
section. Furthermore, I cannot reproduce this error in our example
project. Have you overridden this dependency in your project?
Also the selectable
field is used to create a SelectableText.rich
which has onTap
and onSelectionChanged
optional, so I am not really sure how this could produce a Null check operator used on a null value
error.
I see, your dependency is not an exact version but flutter_markdown: ^
so it accepts the higher versions, so even when we're not overriding this but create a fresh project, pubspec will fetch the latest matching version which is not compatible (checked now your example project and it fetched flutter_markdown 0.6.23
in pubspec.lock)
So clone the repo, run example
app on chrome, open chat, try to select text in any message, or tap the text etc. -> bunch of errors in the dev console Null check operator used on a null value
Hi @geweald 👋
Thanks for bringing this to our attention. I've launched a PR that should fix this.
Feel free to reopen this if the error reoccurs. Thanks!
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
Web, Windows, MacOS, Linux
What version are you using?
Latest
What happened?
When you are on web and click on a message text or start selecting text you get spam of
Null check operator used on a null value
errors in the browser console Sometimes the text selection misbehave because of that tooSteps to reproduce
Supporting info to reproduce
This is an issue with use
MarkdownBody
insidestream_chat_flutter/lib/src/message_widget/message_text.dart
The
flutter_markdown
docs has this sections:Yet
StreamMessageText
setsselectable
totrue
for web and desktop, but theonTapText
andonSelectionChanged
are never set, which causes the error to be thrown.Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct