filePath method

Future<String> filePath({
  1. String? withFilename,
})

Returns the absolute path to the file represented by this task based on the Task.filename (default) or withFilename

If the task is a MultiUploadTask and no withFilename is given, returns the empty string, as there is no single path that can be returned.

Throws a FileSystemException if using external storage on Android (via configuration at startup), and external storage is not available.

Implementation

Future<String> filePath({String? withFilename}) async {
  if (this is MultiUploadTask && withFilename == null) {
    return '';
  }
  final baseDirPath = await baseDirectoryPath(baseDirectory);
  return p.join(baseDirPath, directory, withFilename ?? filename);
}