ExportDestination.appDirectory constructor

const ExportDestination.appDirectory({
  1. bool temporary,
  2. String subdirectory,
})

Keep the file inside the app sandbox and just return the path.

No permissions, no UI, works in tests and background jobs. Use this when the next step is your own code — an upload, a mail attachment, a scheduled backup — rather than the user.

With AppDirectoryDestination.temporary the file lands in the cache directory, which the OS may reclaim at any time; otherwise it goes to the application documents directory.

Implementation

const factory ExportDestination.appDirectory({
  bool temporary,
  String subdirectory,
}) = AppDirectoryDestination;