setStick method

void setStick(
  1. bool value
)

Implementation

void setStick(bool value) {
  if (value) {
    // 调用Conversation 添加置顶
    ConversationRepo.addStickTop(conversationId).then((result) {
      if (!result.isSuccess) {
        _isStick = false;
        notifyListeners();
      }
    });
  } else {
    // 调用Conversation 移除置顶
    ConversationRepo.removeStickTop(conversationId).then((result) {
      if (!result.isSuccess) {
        _isStick = true;
        notifyListeners();
      }
    });
  }
  notifyListeners();
  _isStick = value;
}