blockUser method

Future<void> blockUser(
  1. String userId
)

Blocks a user.

userId is the ID of the user to block.

Throws an exception if blocking fails.

Implementation

Future<void> blockUser(String userId) async {
  try {
    await service.blockUser(
      chatId: chatId,
      userId: currentUserId,
      blockedUserId: userId,
    );
  } catch (e) {
    _error = e.toString();
    notifyListeners();
    rethrow;
  }
}