getDownloadPathV2 static method

Future<String> getDownloadPathV2(
  1. String uuid,
  2. String name
)

Implementation

static Future<String> getDownloadPathV2(String uuid, String name) async {
  bool ismac = Platform.isMacOS;
  var spt = ismac ? "/" : "\\";
  var paths = Platform.resolvedExecutable.split(spt);

  var avpaths = paths.sublist(0, paths.length - 1);
  var imPath = normalize(avpaths.join(spt));
  PackageInfo packageInfo = await PackageInfo.fromPlatform();
  String pkgName = packageInfo.packageName;
  var donwloadpath = join(imPath, pkgName, 'download', uuid, name);
  if (!ismac) {
    final String documentsDirectoryPath = "${Platform.environment['USERPROFILE']}";

    donwloadpath = join(documentsDirectoryPath, "Documents", ".TencentCloudChat", pkgName, "download", uuid, name);
  }
  return donwloadpath;
}