Skip to content
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

When using a custom UserName Builder it doesn't replace all user-name places. #1708

Closed
1 task done
dankomiocevic opened this issue Aug 13, 2023 · 2 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@dankomiocevic
Copy link

Which packages are you using?

stream_chat_flutter, stream_chat_persistance

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter - 6.6.0

What happened?

When setting a custom Username by setting the property bottomRowBuilderWithDefaultWidget from StreamMessageListView and using a custom usernameBuilder. Some parts of the UI do not use the widget to set the Username.

For example, the Reactions Card shows a wrong username:

https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_flutter/lib/src/message_widget/reactions/reactions_card.dart#L132

There should be a way to set a custom UserName for all these scenarios.

Steps to reproduce

- Create a new StreamMessageListView
- Override the `bottomRowBuilderWithDefaultWidget` property with a custom UserName Builder.
- Open the Reactions Card on any message, the username does not match the one created by the custom builder.

Supporting info to reproduce

Relevant log output

-

Flutter analyze output

-

Flutter doctor output

-

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dankomiocevic dankomiocevic added the bug Something isn't working label Aug 13, 2023
@xsahil03x xsahil03x added enhancement New feature or request and removed bug Something isn't working labels Sep 8, 2023
@esarbanis esarbanis added bug Something isn't working and removed enhancement New feature or request labels Nov 2, 2023
@esarbanis
Copy link
Contributor

esarbanis commented Nov 2, 2023

Hi @dankomiocevic thanks for opening this issue.

Seems to me like a bug. While we are working on that, if you do not have any spaces (' ') in your custom username you can do the following workaround:

extension UserExtension on User {
    String? get name => // your implementation here
}

@esarbanis
Copy link
Contributor

Hey @dankomiocevic , although this seemed like a bug at first glance, it is not. The reason is that we have deprecated usernameBuilder in favor of bottomRowBuilderWithDefaultWidget, and the reason is exactly that: we do not override the username in all places, but rather only in the bottom row, as the name suggests.

The above workaround is sufficient to override the username text in all places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants