findAppDocDir static method

Future<void> findAppDocDir()

If running from Flutter, this will get the application's documents directory. If running from tests, it will use the system's temp directory.

Implementation

static Future<void> findAppDocDir() async {
  if (_appDocDir != null) return;

  if (_fileSystem == const LocalFileSystem()) {
    try {
      _appDocDir = await getApplicationDocumentsDirectory();
    } on MissingPluginException catch (_) {
      _appDocDir = const LocalFileSystem().systemTempDirectory;
    }
  } else
    _appDocDir = _fileSystem.systemTempDirectory;
}