stream-chat-flutter
stream-chat-flutter copied to clipboard
Text scale accessibility issues caused by use of WidgetSpan
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
iOS, Android
What version are you using?
4.3.0
What happened?
There are multiple places where WidgetSpan is used, ex in MessageWidget:
WidgetSpan is reacting to textScaleFactor and resizing its content based on that. If the content is also reacting to text scale (for example Text widget) it will be resized twice.
In the case of MessageWidget the timestamp is getting way to big with larger text scale:
One solution is to wrap those children with MediaQuery and set textScaleFactor to 1 to avoid the second resizing.
MediaQuery( data: const MediaQueryData(textScaleFactor: 1.0), child: child, )
Steps to reproduce
Change the text scale in the Accessibility settings of the OS and see how the timestamp under the chat message gets way too big.
Supporting info to reproduce
No response
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct