var systemTempDir = Directory.systemTemp;
Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;
var systemTempDir = Directory.systemTemp;
Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;
Directory.systemTemp is on iOS at least the more correct path than using path_provider's getTemporaryDirectory() function!
They are very different in how they function.
The Directory.systemTemp; variable returns the /tmp folder for iOS for instance whereas the getTemporaryDirectory() function returns the /Library/Caches value.
If you tried natively in Swift on iOS to get the temporary directory using this code
print(FileManager.default.temporaryDirectory)
You would get the /tmp/ function, which is what the Directory.systemTemp variable returns so this should be the way to go.