downloadFile function

dynamic downloadFile(
  1. String fileName,
  2. String donwloadPath,
  3. String path
)

Implementation

downloadFile(String fileName, String donwloadPath, String path) async {
  String savePath = '$path/www/$fileName';
  try {
    Uri uri = Uri.parse(donwloadPath);
    if (uri.host != "") await dio.Dio().download(donwloadPath, savePath);
    //print('$fileName downloaded');
    return;
  } catch (e) {
    //print(e);
    return;
  }
}