setTemporalFolderPath static method

void setTemporalFolderPath(
  1. String path
)

Sets a custom temporary folder path for the library to use.

This method is primarily intended for testing and mocking purposes, allowing you to control where temporary files are stored during tests. It can also be used to customize the temporary directory path for the library's operations on platforms with file system access (Windows, macOS, Linux, Android, iOS).

Note: This setting does not affect web platforms, as they use a different file handling mechanism.

Parameters:

  • path: The absolute path to the custom temporary directory

Example:

// In tests
DocumentUtils.setTemporalFolderPath('./example/assets/temp');

Implementation

static void setTemporalFolderPath(String path) => _temporalDir = path;