How can i delete a cached video
Opened this issue · 2 comments
miracle101000 commented
I have tried to delete cached video but i cannot find the method or function for this. I have asked in stack overflow and have gotten 0 suggestions.
Any suggestions will be appreciated thank you
brainunknown commented
Can you show your code?
Do you have the system file path?
Check if it helps:
Future<void> deleteFile(File file) async {
try {
if (await file.exists()) {
await file.delete();
}
} catch (e) {
// Error in getting access to the file.
}
}
Can be used like:
ElevatedButton(
onPressed: () { deleteFile(File(outputPath)); },
child: Text('Delete')),
}
miracle101000 commented
Thanks,
That’s exactly my problem I can’t seem to have access to the file path @brainunknown. I can’t seem to find the cached video file and I don’t think there is a method from the package that states how to do so