saveFile abstract method

Stream<SaveProgress> saveFile({
  1. required String filePath,
  2. required String fileName,
  3. required FileType fileType,
  4. SaveLocation? saveLocation,
  5. String? subDir,
  6. ConflictResolution conflictResolution = ConflictResolution.autoRename,
})

Saves a file from filePath to device storage with progress streaming.

Platforms: Android · iOS · macOS · Windows · Linux (Web: not supported — browsers cannot access arbitrary file paths)

Streams in chunks — suitable for large files.

  • filePath: Source path (file:// URI or content:// URI on Android)
  • saveLocation: Where to save the file (platform-specific, optional)
  • subDir: Optional subdirectory within the standard save location
  • conflictResolution: How to handle filename conflicts

Yields SaveProgress events during save operation.

Throws SourceFileNotFoundException if the source file does not exist. Throws ICloudDownloadException on iOS if iCloud file download fails.

Implementation

Stream<SaveProgress> saveFile({
  required String filePath,
  required String fileName,
  required FileType fileType,
  SaveLocation? saveLocation,
  String? subDir,
  ConflictResolution conflictResolution = ConflictResolution.autoRename,
});