saveThreadData method

dynamic saveThreadData(
  1. String projectId
)

Implementation

saveThreadData(String projectId) async {
  if (comments.isEmpty) {
    return;
  }
  String version = (await PackageInfo.fromPlatform()).version;
  if (comments.length == 1) {
    var futures = <Future>[
      NetworkRequestUtilsFixle.putToBlobStorage(_imageNameWithoutContainer, _blobPutSasSuffix, pngData),
      NetworkRequestUtilsFixle.addThreadDataToApi(this, projectId, version).then((value) {
        if (value != null) _threadId = value;
      })
    ];
    await Future.wait(futures);
  } else if (comments.length > 1) {
    // edit the thread
    await NetworkRequestUtilsFixle.editThreadDataToApi(this, _threadId, projectId, version);
  }
}