saveImage static method
Implementation
static saveImage(String url) async {
Future<String?> _findPath(String imageUrl) async {
final file = await DefaultCacheManager().getSingleFile(url);
Directory localPath = await getLocalPath();
final name = splitFileNameByPath(file.path);
final result = await file.copy(localPath.path + name);
return result.path;
}
return _findPath(url);
}