cacheFile function
This function creates temporary file on the device storage Return File You can call normal File methods
Implementation
Future<File> cacheFile(String name) async {
Directory tempDir = await getTemporaryDirectory();
return File(pathlib.join(tempDir.path, name));
}