Skip to main content
Block/Unblock lets users prevent specific users from sending them messages. When blocked, the message composer is hidden and replaced with an unblock prompt. Before starting, complete the Getting Started guide.

Components


Integration Steps

1. Navigate to User Info

Open the user info screen from the messages view when tapping the user profile or info icon. File: messages.dart

2. Block User

Call the block user dialog which uses CometChatUIKit.blockUsers() with the target UID. On success, update the UI to show the blocked state. File: cometchat_user_info.dart

3. Unblock User

Call CometChatUIKit.unblockUsers() with the target UID. On success, restore the UI to allow messaging. File: cometchat_user_info_controller.dart

4. Blocked State Banner

Display a warning banner when viewing a blocked user’s profile. File: cometchat_user_info.dart

5. Composer Blocked State

When a user is blocked, the composer in thread/message views is replaced with an unblock prompt. File: cometchat_thread.dart

Feature Matrix


Next Steps

Users

Display and manage user lists.

Message Composer

Customize the message input component.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.