downloadImage static method
Implementation
static Future<void> downloadImage(String imageUrl) async {
try {
var response = await Dio().get(
imageUrl,
options: Options(responseType: ResponseType.bytes),
);
await SaverGallery.saveImage(
Uint8List.fromList(response.data),
fileName: generateImageName(),
skipIfExists: false,
);
showFeedbackSnackbar(Strings.imageDownloadSuccess.tr, Symbols.photo);
} catch (e) {
showErrorSnackbar(Strings.imageDownloadFail.tr);
}
}