updateDialog method

Future<QBDialog?> updateDialog(
  1. String dialogId, {
  2. List<int>? addUsers,
  3. List<int>? removeUsers,
  4. String? dialogName,
  5. String? dialogPhoto,
  6. Map<String, Object>? customData,
})

Implementation

Future<QBDialog?> updateDialog(String dialogId,
    {List<int>? addUsers,
    List<int>? removeUsers,
    String? dialogName,
    String? dialogPhoto,
    Map<String, Object>? customData}) async {
  Map<String, Object> data = Map();

  data["dialogId"] = dialogId;

  if (addUsers != null) {
    data["addUsers"] = addUsers;
  }
  if (removeUsers != null) {
    data["removeUsers"] = removeUsers;
  }
  if (dialogName != null) {
    data["name"] = dialogName;
  }
  if (dialogPhoto != null) {
    data["photo"] = dialogPhoto;
  }
  if (customData != null) {
    data["customData"] = customData;
  }

  Map<Object?, Object?> map = await _chatModule.invokeMethod(UPDATE_DIALOG_METHOD, data);

  QBDialog? updatedDialog = QBDialogMapper.mapToQBDialog(map);

  return updatedDialog;
}