downloadAndUpdate static method

Future<void> downloadAndUpdate(
  1. String url
)

Implementation

static Future<void> downloadAndUpdate(String url) async {
  if (Platform.isAndroid) {
    await _channel.invokeMethod("downloadAndUpdate", {"url": url});
  } else if (Platform.isWindows) {
    String? filePath = await downloadFile(
        Uri.parse(url),
        (await _channel.invokeMethod("getDownloadFolder")).toString() + "\\",
        url.split("/").last);
    if (filePath != null) {
      if ((await _channel
              .invokeMethod("runFileWindows", {"filePath": filePath})) >
          32) {
        exit(0);
      }
    }
  }
}