downloadFile method

dynamic downloadFile(
  1. String url,
  2. BuildContext context
)

Implementation

downloadFile(String url, BuildContext context) async {
  bool downloadedImage =
      await saveImageUrl(url, DateTime.now().toString(), context);

  if (downloadedImage) {
    // ScaffoldMessenger.of(context).hideCurrentSnackBar();
    _loadingService.showSuccess(
      'Downloaded Successfully',
    );
    // log("File Downloaded");
  } else {
    _loadingService.showError(
      'An error occured',
    ); // ScaffoldMessenger.of(context).hideCurrentSnackBar();
    // log("Problem Downloading File");
  }
}