Skip to content

Commit

Permalink
fix: 🐛 hide user name and profile image in single chat #126
Browse files Browse the repository at this point in the history
  • Loading branch information
apurva010 committed May 15, 2024
1 parent 06d5457 commit da7772a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.3.2] (Unreleased)
* **Fix**: [126](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/126) Added
flag to hide user name in chat.


## [1.3.1]

* **Feat**: [105](https://github.com/SimformSolutionsPvtLtd/flutter_chatview/pull/105) Allow user
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,20 @@ ChatView(
```


19. Flag `enableOtherUserName` to hide user name in chat.

```dart
ChatView(
...
featureActiveConfig: const FeatureActiveConfig(
enableOtherUserName: false,
),
...
)
```



## How to use

Expand Down
4 changes: 4 additions & 0 deletions lib/src/models/feature_active_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class FeatureActiveConfig {
this.enableDoubleTapToLike = true,
this.lastSeenAgoBuilderVisibility = true,
this.receiptsBuilderVisibility = true,
this.enableOtherUserName = true,
});

/// Used for enable/disable swipe to reply.
Expand Down Expand Up @@ -49,4 +50,7 @@ class FeatureActiveConfig {

/// Controls the visibility of the message [receiptsBuilder]
final bool receiptsBuilderVisibility;

/// Used for enable/disable other users name.
final bool enableOtherUserName;
}
4 changes: 3 additions & 1 deletion lib/src/widgets/chat_bubble_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
crossAxisAlignment:
isMessageBySender ? CrossAxisAlignment.end : CrossAxisAlignment.start,
children: [
if ((chatController?.chatUsers.length ?? 0) > 1 && !isMessageBySender)
if ((chatController?.chatUsers.length ?? 0) > 1 &&
!isMessageBySender &&
(featureActiveConfig?.enableOtherUserName ?? true))
Padding(
padding:
widget.chatBubbleConfig?.inComingChatBubbleConfig?.padding ??
Expand Down

0 comments on commit da7772a

Please sign in to comment.