saveFile2Album static method

Future<SaveResult?> saveFile2Album(
  1. String filePath, {
  2. String? fileName,
})

将图片文件保存到相册,返回路径

Implementation

static Future<SaveResult?> saveFile2Album(String filePath, {String? fileName,}) async {
  var permResult = await _requestPermission();
  if(permResult.isGranted || permResult.isLimited){
    final result = await ImageGallerySaver.saveFile(filePath,
        name: fileName, isReturnPathOfIOS: true);
    return SaveResult(path: result["filePath"],);
  }
  return SaveResult(permissionDenied: true);
}